Calling A C Function From VB
Hello
How do i call a "C" function from VB. say if i wrote a function mycfunction(myvar1,myvar2), how can i call it from within say the code of a command button.
also can i write the c function in VB in the first place?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Calling An Oracle Package.Procedure Works But Calling A Function In The Package Does Not ?
Hi,
I am trying to call a function in a package in Oracle, from VB. I am using the traditional ADODB with connection, command and parameter objects. The function has 6 input parameters and it returns a string value.
We have no problems reaching the similar Procedure under a package, but when it comes to accessing the function, it gives errors. I got "no descriptor found", after some changes "object stored Procedure does not exist" .
Any suggestions on how differently to access a function within a package as opposed to a procedure ?
Thanks,
Arch
Calling A DLL Function...is This A "calling Convention" Problem?
Hi All, I'm not sure if this has been covered in another thread. I'm trying to call a function in a DLL that was written in C++ and its saying it can't find the entry point, I've got the case and spelling correct.
Heres the C++ example code of how to call it:
LONG DLLFUNC RotorRadioConfigure ( HWND, HANDLE );
and heres my VB code:
public Declare Function RotorRadioConfigure Lib "rr.dll" HWND, HANDLE) as Long
I've also tried using ordinal calls:
public Declare Function RotorRadioConfigure Lib "rr.dll" Alias "#1" (HWND, HANDLE) as Long
But, I don't know which ordinal number to use, I've tried #1 to #8, then VB crashes, there are about 15 functions in the DLL.
On each ordinal call, it just says invalid calling convention.
Any help?
Scott.
---
Freeware VB programs at http://net23uk.freeservers.com
Calling A Vb Function From A Public Function
Hi,
I want to go through a bunch of worksheets and sum up a particular range. I am trying to call the Sum() function from my own public function but I get an error. Can I do this or do I need to write a separate function ? Is there a smarter way to do this ?
Thanks in advance,
Z
Public Function Cal_key_cust_vol(Customer As String, Qrt As String) As Integer
Dim tot As Single
Dim JobList As String
Dim Amt As Integer
Dim Q1_vol As Range
tot = 0: JobList = ""
For i = 1 To Sheets.Count
If Left(Sheets(i).Name, 3) = "Tst" Then
Q1_vol = Sheets(i).Name.Range("D33:L35")
Q1_vol_sum = Sum(Q1_vol)
Debug.Print Q1_vol_sum
If Q1_vol_sum <> 0 Then
tot = tot + Q1_vol_sum
JobList = JobList & Sheets(i).Name & " [" & CStr(Q1_vol_sum) & "]" & Chr(10)
End If
End If
Next i
Application.ThisCell.ClearComments
Application.ThisCell.AddComment.Text JobList
Application.ThisCell.Comment.Shape.Width = 300
Application.ThisCell.Comment.Shape.Height = 200
Cal_key_cust_vol = tot
End Function
Calling A Function From A Paramater Of A Function
Just a quick Q?. I've been told it's possible in C. But is it possible somehow
to call a function from a function parameter. e.g
Private Function CallFunction(byval strFuncName as String)
Call strFuncName
End function
Would be ideal for an app that I want to create to easily addin new procedures e.t.c
Thanx In Advance
Calling A Function, But Exiting Out Of The First Function Too???
I don't think this is possible but I am very curious about this.
I want to know if it is possible to exit a Function/Sub before/After I call another Function/Sub to run.
Example:
Code:
Public Sub Main()
Dim bTest as boolean
Dim lValue as Long
bTest = True
lValue = 12
Call fnNewFunction(lValue, bTest)
Exit Sub
Private Function fnNewFunction(lNewValue as long, bTestValue as boolean)
'Do Something
Call fnAnotherNewFunction()
End Function
Is Sub Main still in memory even after it called another function? I notice that it end exited the sub. So is there a way to make it exit the Function/Sub after a call to another Function/Sub?
Thanks
he9ap00
Error Calling Function From Another Function
Hi all . I have an application that i try to call Command7_Click() from with in Command5_Click function but when i do so i get the following error:
error:
Run-time error 91 object variable or with block variable not set
If i click on a button manually to activate Command7_Click() the function inserts data to mysql without any error. Could any one tell me how to fix this error.Thanks
VB Code:
CNN.Execute "INSERT INTO songstest (filename,title,artist,album,LastModified) VALUES('" & path & "','" & title & "','" & Trim(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(2)) & "','" & Trim(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(3)) & "' , '" & List3.Text & "')"
VB Code:
Private [b]Sub Command5_Click()[/b]Select Case Index Case 0: If Text3.Text <> "" Then Text4.Text = Inet1.OpenURL(Text3.Text, icString) End If Case 1: EndEnd Select[b]Command7_Click[/b]End Sub Private Sub Command7_Click() Dim CNN As ADODB.ConnectionSet CNN = New ADODB.ConnectionCNN.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=visualbasic67;USER=root;PASSWORD=;OPTION=3;" Dim Parser As New clsXMLParser Dim Node As clsXMLNode Dim Child As clsXMLNode Dim fn As Long Dim i As Long Dim path As String Dim title As String fn = FreeFile Open "C: emp.dat" For Output As #fn Print #fn, Text4.Text Close #fn Call Parser.Parse("C: emp.dat") Call Kill("C: emp.dat") Set Node = Parser.ParentNode For i = 1 To Node.ChildrenCount Set Child = Node.enumChild(i) If LCase$(Child.Name) = "song" Then path = Child.getAttribute("path") title = Child.getAttribute("title") [color=red]CNN.Execute "INSERT INTO songstest (filename,title,artist,album,LastModified) VALUES('" & path & "','" & title & "','" & Trim(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(2)) & "','" & Trim(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(3)) & "' , '" & List3.Text & "')" [/color] ===> error pointing at End If Next CNN.Close MsgBox " successfull"End Sub
Error Calling Function From Another Function
Hi all . I have an application that i try to call Command7_Click() from with in Command5_Click function but when i do so i get the following error:
error:
CODERun-time error 91 object variable or with block variable not set
Calling Sub Or Function In A DLL
Hi, trying something similar, but in Outlook and dinamically. Let me explain:
I want a menu structure that mimics the sub-folders in a specific outlook public folder. The problem is that the folder structure is going to change over time. So what I want to know, is it is possible to create buttons dinamically on application startup (doesn't matter which Office app - I can change it to suit Outlook.
I can get the structure no problem - but to get the click event of the last level of buttons, I have to declare them and I don't know how many there are...
Any ideas?
Charles
Calling Sub Or Function In A DLL
Hello all.
I recently converted a bunch of my related macros into a Word Addin.
The addin adds a menu and submenus to one of the toolbars. The problem I am having now is my .OnAction events for each item of the menu are looking to the Normal.dot template for the specified sub... I have been unable to properly reference the sub in the addin dll where the actual routines are stored...!
Is it something like...
.OnAction = dllName + "!subName" ???
Any suggestions?
Thanks
Calling A Function
All
I know i can call a function as follows
Code:
Function Test(Input As String)
End Function
Sub Test()
Test MyInput
End Sub
But how do i call a function that is named
Code:
Private Function Test(ByVal Input As String) As String
Cheers
Gibbo
Calling A Function From VBS
hey, I am trying to call a function from a VBS file from VB and put the result into a message box or whatever. I haven't a clue where to start. Can anybody help me with this?
Calling A Function...
Heres my deal. I already made a command for like command1 click or whatever, can I somehow make like a timer to do that fuction without the code being in timer itself?
Calling Function From A C++ Dll In Vb
I am trying to call a function from a c++ dll from a vb program. There are two parameters that ar passed into the function. The values are changed and passed back. When the function is called I get the message "Bad DLL calling convention" which means I have screwed up the parameter declarations. I have tried an asortment of variations without success.
A sample of the c++ dll code is:
TESTDLL_API int fnTestdll(int *n1, int *n2)
{
*n1 = 22;
*n2 = 33;
return 42;
}
I do have the def file:
; testdll.dll
LIBRARY"testdll"
;CODE PRELOAD MOVEABLE DISCHARGABLE
;DATA PRELOAD MOVEABLE
EXPORTS fnTestdll@1
The sample vb program is:
Private Declare Function fnTestdll _ Lib "c: emp estdlldebug estdll.dll" _
(ByRef v1 As Long, ByRef v2 As Long) As Long
Dim nn As Long
Dim mm As Long
Dim iret As Long
Private Sub Form_Load()
nn = 66
yy = 222
iret = fnTestdll(nn, yy)
End Sub
Calling DLL Function
I've got a dll written in c++ that I want to call from VB. The particular function I want to call accepts (const char *file) as a parameter. I also had trouble registering the DLL using regsvr32 so I thought I'd just declare the function in my code. So I've got a couple questions:
1) If the function expects const char *file as a parameter, what do I pass it from VB?
2) Why do I get "the.dll was loaded, but the DLLRegisterServer entry point was not found" when I try to register it?
Thanks for any help...
--tim
Calling A Function
i have been programming in php for awhile. so i decided the other day to learn visual basic. seems like a good language to learn. picked up the book "visual basic in easy steps".
i have gotten stuck on calling a function. the form is laid out like this.
centimeters: <list box is here>
In inches: <label2 is here>
<convert to inches button here>
i want to convert centimeters to inches. i keep getting an error when trying to call the function. so i took it out; just to see if what i type in shows up in label2 and it does. here is the code.
Code:
Function cmToInch(cmVar As Single) As Single
cmToInch = cmVar / 2.54
End Function
Private Sub Command1_Click()
Label2.Caption = Str(Val(Text1.Text))
End Sub
Private Sub Form_Load()
End Sub
can someone explain and show how this code should be written to call the function and convert centimeters to inches.
thanks,
ch0311
Calling A Function From A Sub ?
Now this is probably a bit basic, but I have my VB6 book at work, and I would like to get over this hurdle...
How do I call this function from within say.. the form_load sub ? I wish to put a code in for the day as shown below, but I dont know g=how to call it like you do when you call another sub.
Function DateSerial(Year As Integer, Month As Integer, Day As Integer)
datecode = (Year + Month + Day)
Text1.Text = datecode
'deal with datecode
End Function
Thanks in advance... Chris- West Oz
Calling A C Function From VB
I am trying to make a call to a C DLL function and I keep getting an error 49 “Bad DLL calling convention”. The DLL help includes a .h file for the DLL and the function is declared as follows:
Code:
int32 DllExport __CFUNC DAQmxBaseCreateTask (const char taskName[], TaskHandle *taskHandle);
My VB code declares the function as follows:
Code:
Public Declare Function DAQmxBaseCreateTask Lib "nidaqmxbase.dll" (ByVal taskName As String, ByRef taskHandle As Long) As Long
And I make a call to the function in my VB code as follows – taskHandle is a long - :
Code:
DAQmxError = DAQmxBaseCreateTask("Test", taskHandle)
I’ve tried just about everything I can think of to make this work but I can’t seem to get it right.
Any help would be appreciated.
Calling C Function
Hello folks!
I know this might be a stupid thread, but I really don't know how to call this C function from VB:
Code:
CRCDLL unsigned short int CRCDLL_CRC_16 (unsigned short int crc, unsigned short int len, unsigned char buf[])
{
unsigned short int i = 0;
for (i = 0; i < len; i++)
crc=(crc >> 8) ^ crc_16_tab[(crc ^ *buf++) & 0xff];
return (crc);
}
I am using the following call:
Code:
Private Declare Function CRC16 Lib "F:Documents and SettingsSebastian MaresDesktop23077CRC_DLLReleaseCRCDLL.dll" Alias "?CRCDLL_CRC_16@@YAGGGQAE@Z" (Result As Integer, Length As Integer, Data() As Byte) As Integer
...
Dim Result As Integer, ByteArray() As Byte
ByteArray = StrConv("Hello!", vbFromUnicode)
CRC16 Result, 6, ByteArray
When I use that, I get a bad DLL calling convention.
Function Calling
Hi, I'm new to this forum and to VB. All I am trying to do is to call a mnuSave sub function. I've already written the code and I just want to use it in the Exit menu item...so that each time you click 'exit' it will prompt you to save (and not just text so I cant use the RTF.SaveFile call).
something like:
Private Sub mnuExitItem
mnuSaveItem
Unload Form1
End Sub
Calling On A Function
i am not realy familure with moduals and stuff , if i have a function that i use alot like
if num = 1 then
bla bla
end if
i know i would declare num in a modual as a public integer, but say i want to call the function in my form with a button so when i press the button the button code would be
button_click()
num = 1
end sub
so when the button is pressed it will do the fuction stated above without having to type it every time i want the function to be used.
i hope this makes sence
Calling C++ Function
I want to call this C++ function from my VB6 App, how do I do it? The function is located in a dll called d3d9.dll.
C++ Func:
Code:
void DrawCustomText(int X, int Y, char* Text, int Line)
{
if(Line <= 10)
{
if(Line == 1) { Line1 = Text; }
if(Line == 2) { Line2 = Text; }
if(Line == 3) { Line3 = Text; }
if(Line == 4) { Line4 = Text; }
if(Line == 5) { Line5 = Text; }
if(Line == 6) { Line6 = Text; }
if(Line == 7) { Line7 = Text; }
if(Line == 8) { Line8 = Text; }
if(Line == 9) { Line9 = Text; }
if(Line == 10) { Line10 = Text; }
FontPosition.top = 11 * Line;
FontPosition.left = 10;
g_Font->DrawText( NULL,Text,-1,&FontPosition,DT_LEFT,0xFFFFFFFF);
}
if(Line == 11)
{
Line1 = Line2;
Line2 = Line3;
Line3 = Line4;
Line4 = Line5;
Line5 = Line6;
Line6 = Text;
}
}
Calling Same Function Before It Done...
Just wondering if this is possible, ex:
mainfunction, function1, function2, function3, function4
mainfunction calls function1, which calls 2, which calls 3, which calls 4.
This chain of event can take a long time... is it possible to have mainfunction start function1 (lets say) three times with 3 different sets of data. Once the first one of those 3 ends, it re-start function1 with a new set of data.... it would basically loop thru all of this data until done.
Dont know if this falls in multi threaded or not. I suppose this could be done with a array of a class, but then again, you run into the same problem as telling the code to "continue"....
Calling A Function
My code is below. I get an error: Compile error: Expect variable or procedure, not module. When I hit ok when debugging it highlights in yellow with frmControl: Private Sub cmdSaveconfig_Click()
I'm re-learning this stuff so maybe I forgot something. If I take the code from the module and replace the "Call Keycodes(frmControl)" with the code it will execute fine.
I have a module that has a function in it
VB Code:
Public Function Keycodes(frmControl As Form) Select Case config Case Is = "a" keycode = vbKeyA Case Is = "b" keycode = vbKeyB Case Is = "c" keycode = vbKeyC Case Is = "d" keycode = vbKeyD Case Is = "e" keycode = vbKeyE Case Is = "f" keycode = vbKeyF Case Is = "g" keycode = vbKeyG Case Is = "h" keycode = vbKeyH Case Is = "i" keycode = vbKeyI Case Is = "j" keycode = vbKeyJ Case Is = "k" keycode = vbKeyK Case Is = "l" keycode = vbKeyL Case Is = "m" keycode = vbKeyM Case Is = "n" keycode = vbKeyN Case Is = "o" keycode = vbKeyO Case Is = "p" keycode = vbKeyP Case Is = "q" keycode = vbKeyQ Case Is = "r" keycode = vbKeyR Case Is = "s" keycode = vbKeyS Case Is = "t" keycode = vbKeyT Case Is = "u" keycode = vbKeyU Case Is = "v" keycode = vbKeyV Case Is = "w" keycode = vbKeyW Case Is = "x" keycode = vbKeyX Case Is = "y" keycode = vbKeyY Case Is = "z" keycode = vbKeyZ End Select End Function
Have a form called "frmControl" that has this code
VB Code:
Private Sub cmdSaveconfig_Click() config = txtUp.TextCall Keycodes(frmControl)config_up = keycode config = txtDown.TextCall Keycodes(frmControl)config_down = keycode config = txtLeft.TextCall Keycodes(frmControl)config_left = keycode config = txtRight.TextCall Keycodes(frmControl)config_right = keycode config = txtSquare.TextCall Keycodes(frmControl)config_square = keycode config = txtCircle.TextCall Keycodes(frmControl)config_circle = keycode config = txtCross.TextCall Keycodes(frmControl)config_cross = keycode config = txtTriangle.TextCall Keycodes(frmControl)config_triangle = keycode config = txtStart.TextCall Keycodes(frmControl)config_start = keycode config = txtSelect.TextCall Keycodes(frmControl)config_select = keycode config = txtR.TextCall Keycodes(frmControl)config_r = keycode config = txtL.TextCall Keycodes(frmControl)config_l = keycode Open "C:ButtonConfig.txt" For Output As #1Write #1, config_upWrite #1, config_downWrite #1, config_leftWrite #1, config_rightWrite #1, config_squareWrite #1, config_circleWrite #1, config_crossWrite #1, config_triangleWrite #1, config_startWrite #1, config_selectWrite #1, config_rWrite #1, config_lClose 1Unload frmControlEnd Sub
Calling A Function
i found this interesting,
i tried to call a function this way
VB Code:
load_rx_values(a_index, b_index)
and it throws a compile error
expected: =
but if i do
VB Code:
Call load_rx_values(a_index, b_index)
there is no problem
does calling a function without explictly doing a call limit the function to one passed variable
Calling A Function
Hello
if i have a private function say calc_salary
do i need to call it like
calc_salary or
call calc_salary
Calling Function
Hi
I am a bit new to ASP and i want to know how do i do this
VB Code:
<SCRIPT language="vbscript"> sub Con_onclick() '*** call the function that is in asp on the same page end sub </SCRIPT> <% Function DoSomething() end Function%>
How do i call the function from a Onclick event ?
Calling The Same Function
Can i call the same function twice at the same time??
for example...
VB Code:
private cmd_Command_Click(Index) blah blahend sub
What happens if the function was called at the same time by 2 different calls ....obviously with different index's.
Will it work....or do i need 2 seperate functions??
Matt
Function Calling Itself?
Hi, I'm looking at a function that someone else wrote and I don't understand how the following works... basically when the function gets called, it performs some operations and if a certain condition is true, it will call itself. Now the trick is, say myvar="apples" the first time the function is called and then as the function is running, it changes myvar="oranges" and then calls itself. After the oranges run is done, the function will know enough to continue the "apples" run from where it left off. How does it remember a variable that was changed? This is just a simplified version of what this actual function is doing, because it will call itself in this nested fashion perhaps 5 times in a row and "remember" to return back to each previous run. It's just magic to me right now!
Calling Function
VB Code:
Sub getseti()statepath = App.Path + "state.sah" Open statepath For Input As #1 DoLine Input #1, tempstrstring = strstring & vbCrLf & tempLoop While EOF(1) = False strProgress = "prog=" npost = InStr(1, strstring, strProgress)If npost = 0 Then MsgBox "Please make sure you have placed SETI LCD in your SETI folder containing state.sah" nposts = npost + 5 progress = Mid(strstring, nposts, 6) progr = progress * 100 end sub
then
VB Code:
text1.text = getseti
how can I do this?
what is wrong with my code?
Shak
Calling A Function?
How do I call a function? I know how to call a Sub, but the simple "Call" function doesn't seem to work when calling functions
Thanks
Calling A Function?
Hi,
I'm changing some code a friend wrote for me. Unfortunately she's gone to Spain. She wrote the code with a picture box in mind, but I'm changing it to a textbox - makes more sense.
In a command button I have:
Command1_Click()
Text1 = "We are being asked to find the value of 'x'." & _
"Firstly, we have to tidy up the left side of the equation,"
qShow
End sub
This then calls the function, qShow
It works fine for the code as a Picturebox:
Sub qShow()
If b < 0 Then Pictext.Print Trim$(a); "(x" & Trim$(b) & ")" _ Else: Pictext.Print Trim$(a); "(x+"; Trim$(b); ")"
End Sub
But if I change Pictext.Print to Text1.Text, I get the following error:
Compile Error: Expected: End of Statement, and ";" is highlighted. Could someone please tell me how to sort this out?
Thanks a lot!
Calling Function From DLL In VC++
Hi,
I am trying to run a function inside a class (vc++) from vb5
is this possible?
the function is Open in Class CommCtrl.
After this didn't work I created another function Open not in any Class ( I wanted to know if this will work as stand alone)
but even this didn't work I get the same error over and over
Run Time Error 49 :"Bad Dll Calling Convention"
I don't c how can I attach the project here.
Calling Function From DLL In VC++
Hi,
I am trying to run a function inside a class (vc++) from vb5
is this possible?
the function is Open in Class CommCtrl.
After this didn't work I created another function Open not in any Class ( I wanted to know if this will work as stand alone)
but even this didn't work I get the same error over and over
Run Time Error 49 :"Bad Dll Calling Convention"
I don't c how can I attach the project here.
Calling Function From DLL In VC++
Hi,
I am trying to run a function inside a class (vc++) from vb5
is this possible?
the function is Open in Class CommCtrl.
After this didn't work I created another function Open not in any Class ( I wanted to know if this will work as stand alone)
but even this didn't work I get the same error over and over
Run Time Error 49 :"Bad Dll Calling Convention"
I don't c how can I attach the project here.
Calling Function From DLL In VC++
Hi,
I am trying to run a function inside a class (vc++) from vb5
is this possible?
the function is Open in Class CommCtrl.
After this didn't work I created another function Open not in any Class ( I wanted to know if this will work as stand alone)
but even this didn't work I get the same error over and over
Run Time Error 49 :"Bad Dll Calling Convention"
I don't c how can I attach the project here.
Calling/using Vb.net Function In Vb6
hi,
is there any way to use/access a function made with vb.net in vb6? i've have to make a function from php to vb and some php functions can't be done with vb6 but can be with vb.net. we're on a tight schedule so upgrading the whole app to .net might delay things.
Calling Function
<P>Hello Friends,</P>
<P>   I've written the code of converting nos to words on command1_lick button.And also the functions like Digitcalc,decimalcalc and also theother functions.Also i've written the calculation of pay on <STRONG>cmdPropay_Click() </STRONG>command button which calculates the net amt. payable.BR> &nbs p; Now what i want is to onvert this t_netpay amt in cmdprocpay_click button into figures.Nowwhat happens is i enter the amount in text1.text and after pressing comman1_click button i get the amount in figures,but i want to supply the <STRON>t<EM>_netpay </EM></STRONG>values to the functions.All the functions are ublic except the command button code of command1_click and cmdProcpay_clic.</P>
<P>Please help me ASAP.Given are the code below.</P>
<P><BR>Regads,<BR>Prashant.</P>
<P><STRONG>Private Sub Command1_Click()<BR></STRONG Dgt1 = Text1.Text<BR> decipos = 0BR> decipos = InStr(1, Text1.Text, ".")<BR>   If decipos > 0 Then<BR> Dgt1= Mid(Text1.Text, 1, (decipos - 1))<BR> Else<BR> nbsp; Dgt1 = Mid(Text1.Text, 1, (Len(Text1.Text))<BR> End If<BR> If decipos = 0 ThenBR> sss = DigitCalc(Dgt1)<BR> &bsp; Else<BR> sss1 = DigitCalcDgt1)<BR> &nb sp; Dgt1 = Mid(Text1.Text, (deipos) + 1, Len(Text1.Text))<BR> & nbsp; sss2= DecimalCalc(Dgt1)<BR> If sss2 <gt; "" Then<BR> & nbsp;   sss2 = " and " & sss2 & " Paise "<BR> &nsp; End If<BR> ss = sss1 &sss2<BR> End If<BR> <BR> &nsp; MsgBox ss<BR>End Sub</P>
<P><BR><STRONG>Public Function DigitCalc(tmDgt As Long) As String<BR></STRONG>ss = "Rupees"<BR>Dim DW As Integer<BRDim GetLen As Integer<BR>Dgt = tmpDgt<BR> ' get the length o the digit<BR> GetLen = Len(Dgt)</P>
<P> '' chck for ten's Laksh</P>
<P> If GetLen = 7 Then '' in ten's akhs<BR> FstDgt = left(Dgt, 2)<BR>&nsp; If FstDgt >= 20 And FstDgt <= 9 Then<BR> & nbsp; F1= left(FstDgt, 1)<BR> &nbs p;&nbp; F1 = F1 * 10<BR> &nb sp ss = ConvertTens2Word(F1)<BR> &nb sp;nbsp; F2 = Right(FstDgt, 1)<BR>     ; ss = ss & " " & ConvetDigit2Word(F2) & " Lakhs "</P>
<P> &nbp; ElseIf FstDgt >= 11 And FstDgt <= 19 Then<BR> &nbs; &n bsp; ss = ss & " " & Convrt2Digit2Word(FstDgt) & " Lakhs "<BR> &nbp; End If<BR> Dgt = Mid(Dgt, 3, GetLn)</P>
<P> ElseIf GetLen = 6 Then '' in single digit lakh<R> FstDgt = left(Dgt, 1)<BR> &nsp; ss = ss & " " & ConvertDigit2Word(FsDgt) & " Lakhs "<BR> Dgt = Mid(Dt, 2, GetLen)<BR> End If</P>
<P> '' check for Thusands<BR> GetLen = Len(Dgt)<BR> If GetLen = 5 =
Function Calling
Hello Friends,
I've written some code on command1_click
button,after
pressing the command button the figures in text1.text gets
converted into words i.e. 123 gets converted to one thousand
twenty three and i've written 3 to 4 public functions.
I've written the calculation part on process command
button
When pressed the button the calculation of netpay is done.Now
what
i want is in my report when i get the netpay amt. i want that
amount to be spelled in words thru the above funcion.Please tell
me how to go about it.
Regards,
Prashant.
Calling Function From Another EXE
--Boundary_(ID_Aqpd7zbSat81iidEgcsP8g)
Content-type: text/plain
Content-transfer-encoding: 7BIT
Hi Guys
I have a Delphi exe that has functions and methods that I want to call from
my VB app. Any idea how to go about this. I have the Delphi exe, but not the
source. I also have the functions etc and their input parameters.
Regards.
Larry.
NOTICE OF CONFIDENTIALITY
The information contained in this e-mail message and in the documents
attached herewith (hereinafter "the message") is intended only for the
individual or the entity named above and is intended to be confidential.
The reading of the message or any retention, copying, dissemination,
distribution, disclosure of the existence of the message or of its contents,
or any other use of the message or any part thereof, by anyone other than
the intended recipient is strictly prohibited. If you received this message
and you are not the intended recipient or agent responsible for the delivery
of this message to the intended recipient, please refrain from reading it
and notify us immediately by telephone +27 (11) 921-7900, so that we can
co-ordinate with you, erasure of the message.
Although this e-mail and its attachments are believed to be free of any
virus or other defect, it is the responsibility of the recipient to ensure
that they are virus-free, and no responsibility is accepted by this firm for
any loss or damage arising from receipt or use thereof.
--Boundary_(ID_Aqpd7zbSat81iidEgcsP8g)
Content-type: text/html
Content-transfer-encoding: 7BIT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Tahoma size=2><SPAN class`2144809-26082003>Hi
Guys</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN
class`2144809-26082003></SPAN></FONT> </DIV>
<DIV><FONT face=Tahoma size=2><SPAN class`2144809-26082003>I have a Delphi exe
that has functions and methods that I want to call from my VB app. Any idea how
to go about this. I have the Delphi exe, but not the source. I also have the
functions etc and their input parameters.</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN
class`2144809-26082003></SPAN></FONT> </DIV>
<DIV><FONT face=Tahoma size=2><SPAN
class`2144809-26082003>Regards.</SPAN></FONT></DI V>
<DIV><FONT face=Tahoma size=2><SPAN
class`2144809-26082003></SPAN></FONT> </DIV>
<DIV><FONT face=Tahoma size=2><SPAN
class`2144809-26082003>Larry.</SPAN></FONT></DIV> </BODY></HTML>
<BR>
<BR>
<P><B><FONT SIZE=2 FACE="Arial">NOTICE OF CONFIDENTIALITY</FONT></B></P>
<BR>
<P><B><FONT SIZE=2 FACE="Arial">The information contained in this e-mail message and in the documents attached herewith (hereinafter "the message") is intended only for the individual or the entity named above and is intended to be confidential.</FONT></B></P>
<BR>
<P><FONT SIZE=2 FACE="Arial">The reading of the message or any retention, copying, dissemination, distribution, disclosure of the existence of the message or of its contents, or any other use of the message or any part thereof, by anyone other than the intended recipient is strictly prohibited. If you received this message and you are not the intended recipient or agent responsible for the delivery of this message to the intended recipient, please refrain from reading it and notify us immediately by telephone +27 (11) 921-7900, so that we can co-ordinate with you, erasure of the message.</FONT></P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Although this e-mail and its attachments are believed to be free of any virus or other defect, it is the responsibility of the recipient to ensure that they are virus-free, and no responsibility is accepted by this firm for any loss or damage arising from receipt or use thereof.</FONT></P>
<BR>
<BR>
--Boundary_(ID_Aqpd7zbSat81iidEgcsP8g)--
Calling Dll Function With VB
below is my VB code..
Private Sub cmd_read_Click()
Dim nResult As Integer
Dim nPort As Integer
Dim sRdrName As String
Dim lResult As Long
nResult = OpenReader
nPort = 1
sRdrName = "IRIS SCR30U 0"
lResult = cardConnect(nPort, sRdrName, Len(sRdrName))
nResult = SelJPNApp()
Dim MyKadName As String
Text1.Text = IDNum
IDNum = ""
nResult = JPN_IDNum(IDNum)
nResult = CardDisconnect()
nResult = CloseReader()
End Sub
when i run F8, at nResult = JPN_IDNum(IDNum) it says cnnot find dll entry point for _JPN_IDNum@4..why?
below is my module..
Option Explicit
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' General Declaration
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Declare Function OpenReader Lib "gsdkpcsc.dll" Alias "_OpenReader@0" _
() As Integer ' open communication session with the card reader
Declare Function cardConnect Lib "gsdkpcsc.dll" Alias "_CardConnect@12" _
(ByVal port As Integer, ByVal Rdrname As String, ByVal nRdrLen As Integer) As Long
' open communication session with the card in the reader
Declare Function CardDisconnect Lib "gsdkpcsc.dll" _
Alias "_CardDisconnect@0" _
() As Integer
' Closes communication session with the card in the reader
Declare Function CloseReader Lib "gsdkpcsc.dll" Alias "_CloseReader@0" _
() As Integer
' Closes communication session with the card reader
Declare Function CardDetect Lib "gsdkpcsc.dll" Alias "_CardDetect@4" _
(ByVal pcExplanation As String) As Integer
' Checks if card is in card reader
Declare Function ResetCard Lib "gsdkpcsc.dll" Alias "_ResetCard@0" _
() As Long
' Reset the card
Declare Function GetError Lib "gsdkpcsc.dll" Alias "_GetError@0" _
() As Integer
' returns information on last error that occured
Declare Function SelJPNApp Lib "gsdkpcsc.dll" Alias "_SelJPNApp@0" _
() As Integer
' select JPN to read JPN data
'*************************************************************************
' JPN section
'*************************************************************************
Declare Function JPN_OrgName Lib "gsdkpcsc.dll" _
Alias "_JPN_OrgName@4" _
(ByVal pbOrgName As String) As Integer
'original name in 150 bytes
Declare Function JPN_MyKadName Lib "gsdkpcsc.dll" _
Alias "_JPN_MyKadName@4" _
(ByVal pbMyKadName As String) As Integer
' 3 lines of name stored in blocks 0f 30+30+20=80
Declare Function JPN_KPTName Lib "gsdkpcsc.dll" _
Alias "_JPN_KPTName@4" _
(ByVal pbKPTName As String) As Integer
' KPTName is 40bytes , 2 lines of name stored in blocks of 20+20=40
Declare Function JPN_IDNum Lib "gsdkpcsc.dll" _
Alias "_JPN_IDNum@4" _
(ByVal pbIDNum As String) As Integer
' ID number in 13bytes
Calling Function
in my application i have created an activex dll which all of the base section of the application is located in that dll. now my question is this:
application named app1
contains a public function named pub_func()
call activex dll named Obj_active_Dll
i need to call named pub_func() from inside the Obj_active_Dll
is this possible ? if yes how?
thanks
Calling A Db Function From Vb6
Hi All
I've trying looking through the FAQs section and didnt see anything about my topic so here goes. In most of the applications I've written, I've done all the db work on the client side. Specifically in vb6, i would make a ADODB call up to the db, using a SQL statement to retrieve data from the table, and return it into a recordset.
However for this project, we are going to try to write some functions on the database side to do the work and handle the logic and my vb6 program is going to call those functions (pass in some parameters) and get a response back. I'm not sure how to do it and I've searched here and google without any luck. Someone else will be handling creating the functions on the db side. I just need to know how to make a function call to a SQL db from vb6. If anyone can point me in the right direction, I'd really appreciate it.
Bruce
"If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it." --W.C. Fields
Saba
Calling A Function
Hello there! Is there a way for me to call a function from a dll by calling it with a different name. For example, if there's FunctionA() in a dll, can i call it by:
Call FunctionAB()
Thank You
Calling A Dll Function
i have a dll called "swscan.dll" located at c:
i have written
"Public Declare Function SWDinit Lib "c:scan.dll" () _
As Integer"
and then tried to call :
"Dim iResult As Integer
iResult = SWDinit"
but all i get from
Dim s As String
s = Err.Description"
is the message "File not found : c:scan.dll"
What could be the problem ?
I have also tried to locate my dll into c:windowssystem32 with no results at all.
Calling A Function In A VC Dll.
Hi,
I need to call a function in a VC DLL that is defined like this:
COMMON_EXPORT void MyFunc (CString FileName, CString InputStr, CString *OutputStr);
I have declared the function in my VB program like this:
Private Declare Sub MyFunc Lib "Common" Alias "#2" _
(ByVal ProjPath As String, ByVal ProjVar As String, ByRef StorString As Variant)
And the call is:
MyFunc ProjectName + vbNullChar, "top_assembly:" + vbNullChar, TopAsslyName
But, it does not work.
Any ideas?
Thanks in advance.
Calling VB Function From C
Hello,
I try to access to an activeX control created in VB from C.
The access to my VB function succed, every function I call works fine, but my control doesn't refresh.
Have an idea, thanks, Olivier...
Calling VB Function From C++ DLL
Hi,
I have a function in Vb whose declaration is
"Public Sub VBFunc(sn_String as string)"
Now I want this function to be called by C++ DLL(Test.dll). So I declered a method in DLL to get the address of this VB function:
STDMETHODIMP CTest::RegisterCallback(long fnPtr)
{
typedef void (__stdcall *FUNCPTR)(BSTR pbstr);
CComBSTR bAccString(pucStr); //pucStr is a global string
vbFunc = (FUNCPTR)fnPtr;
vbFunc(bAccString); //Access violation happens here <=====
}
From Vb side I call this function as follows:
"Public o_Connect As New Test.APIs"
Then i called
"o_Connect.RegisterCallback AddressOf VBFunc" to register the address of the VB function.
When I try to call the VB function from DLL, (refer the function CTest::RegisterCallback above), I receive the access violation in the last line (indicated above).
Why does it happen like that??
Thanks and regards,
Girish V
Calling A DLL Function
Hi
I have written a small DLL in VB and am calling a function from that DLL in VB only. I declared the Function using DECLARE command in my VBP project. But call to that fuction is giving the error "Can not find DLL entry point FUNCTIONNAME in DLLName
|