| | |
Calling c++ dll in vb
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hello,
I am calling a c++ dll in vb...
Everything is working fine..
Just i am unable to write the vb code in order to perform the require action...
Code for calling the c++ dll in vb
So i have 3 text boxes and a command button on the form
text1.text = takes text
text2.text = takes keyz
and when i click on Command1_Click() the result must be displayed in text3
I have tried
Its not working can anyone help how we can solve the problem
I am calling a c++ dll in vb...
Everything is working fine..
Just i am unable to write the vb code in order to perform the require action...
Code for calling the c++ dll in vb
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Declare Function do_encrypt Lib "AES.dll" (ByVal text As String, ByVal keyz As String) As String
So i have 3 text boxes and a command button on the form
text1.text = takes text
text2.text = takes keyz
and when i click on Command1_Click() the result must be displayed in text3
I have tried
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() Text3.text = Str(do_encrypt, Val(Text1.text), Val(Text2.text)) End Sub
Hello I have tired to change the code in the comand1_click() to
but still getting errors...
I am posting the codes in zip file...
Can anyone help how we can solve the problem....
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Text3.text=do_encrypt(Text1.text,Text2.text)
I am posting the codes in zip file...
Can anyone help how we can solve the problem....
Hello,
I am calling a c++ dll in vb..
The c++ code function is returning a value as a double...
Now in the VB code:-I have called the example2.dll
Now I want to get the time in the textbox5
I have wriiten the code:-
Its not responding and i have to end the program...
Can anyone help...
I am calling a c++ dll in vb..
The c++ code function is returning a value as a double...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
double _stdcall aesen(string path1, string path2, string path3) {double time; . . . return time; }
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Declare Function aesen Lib "example2.dll" (ByVal path1 As String, ByVal path2 As String, ByVal path3 As String) As String
I have wriiten the code:-
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command5_Click() Text5.text = aesen(Text1.text, Text2.text, Text3.text) End Sub
Can anyone help...
did you try to register the dll with your operating system?
if not then try using this command :-
regsvr32 <your dll file name>.Dll
then create a reference to the file from Project->References
if not then try using this command :-
regsvr32 <your dll file name>.Dll
then create a reference to the file from Project->References
Last edited by choudhuryshouvi; Mar 29th, 2008 at 11:44 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
Hello,
I am posting a new code in zip format...
Can anyone help just to be able to call the function aesen from the c++ dll and display the time in one of the textbox...
I have tried a function that converts low case letters to uppercase its working...
When running the vb forms text2.text takes p.txt and text3.text = encrypt.txt and text4.text= text.txt and the button encrypt must display the time for the keyshe_time...
The time that is returned in the c++ dll
Can anyone help me to solve this problem...
I am posting a new code in zip format...
Can anyone help just to be able to call the function aesen from the c++ dll and display the time in one of the textbox...
I have tried a function that converts low case letters to uppercase its working...
When running the vb forms text2.text takes p.txt and text3.text = encrypt.txt and text4.text= text.txt and the button encrypt must display the time for the keyshe_time...
The time that is returned in the c++ dll
Can anyone help me to solve this problem...
Hello,
I have a function written in c++ to get the size of a file...
I have tested it by calling it in the main...
Thats working fine...Now i have created a dll of the code and call it form the vb
Now if i call it from the vb i am getting an error message c++ assertion debug,abort,retry
The c++ code...
Thats working fine...
In the VB code i am calling it by...using this code that is the dll
Now in the vb code i have a browse button to select the file p.txt and i get the path in a textbox2..That is i open the file p.txt and gets its path in the textbox2..
Now when i click the button 1 its not working...and i have to display the size of the file in the textbox3
Can anyone help to solve the problem..
I have a function written in c++ to get the size of a file...
I have tested it by calling it in the main...
Thats working fine...Now i have created a dll of the code and call it form the vb
Now if i call it from the vb i am getting an error message c++ assertion debug,abort,retry
The c++ code...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
#include<iostream> #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <windows.h> #include <string.h> #include <memory.h> #include <process.h> #include <tchar.h> #include <dos.h> #include <conio.h> #include <fstream> #include <string> # include <bitset> #include <cstring> #include <algorithm> using namespace std; #include <time.h> int _stdcall ss(string de) { int size; ifstream myfile456 (de.c_str(), ios::binary); myfile456.seekg (0, ios::end); size = myfile456.tellg(); cout << "File size is: " << size << " bytes.\n"; return (size); } int main() { ss("c:/p.txt"); return 0; }
In the VB code i am calling it by...using this code that is the dll
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Declare Function ss Lib "testing.dll" (ByVal de As String) As Integer
Now when i click the button 1 its not working...and i have to display the size of the file in the textbox3
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() Text3.Text = ss(Text2.Text) End Sub
I hope you realize that std::string in c++ programs is not the same as a String in VB. The function exported in the dll needs to be written in such a way that it can be called from languages other than c++, such as this:
or this
int _stdcall ss(const char* de) or this
int _stdcall ss(VARIANT* de) Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Calling external files (C++)
- Microsoft Visual C++/ODBC lookup (C++)
- @@Help with calling VC++ DLL from DEV C++@@ (C++)
- working with dll (Visual Basic 4 / 5 / 6)
- msvcrl.dll (Viruses, Spyware and other Nasties)
- ActiveX DLL reference (Visual Basic 4 / 5 / 6)
- Writing a Win32 DLL in VC++ (C++)
- What is baszu.dll? (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Converting For...Next to Do...While
- Next Thread: Initialisation of Variables
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






