Click here to Skip to main content
16,006,065 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalexception Pin
marouane miftah el kheir13-Feb-02 18:33
marouane miftah el kheir13-Feb-02 18:33 
GeneralRe: exception Pin
Nish Nishant13-Feb-02 19:41
sitebuilderNish Nishant13-Feb-02 19:41 
GeneralRe: exception Pin
Jon Hulatt13-Feb-02 23:25
Jon Hulatt13-Feb-02 23:25 
GeneralCompiled .dll in C++ for use in VB Pin
Nick Parker13-Feb-02 16:49
protectorNick Parker13-Feb-02 16:49 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Derek Waters13-Feb-02 17:13
Derek Waters13-Feb-02 17:13 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Nick Parker13-Feb-02 17:30
protectorNick Parker13-Feb-02 17:30 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Rick York13-Feb-02 17:24
mveRick York13-Feb-02 17:24 
GeneralRe: Compiled .dll in C++ for use in VB Pin
Paul M Watt13-Feb-02 17:48
mentorPaul M Watt13-Feb-02 17:48 
The function that you just wrote should be written like this to export it from the DLL.

__declspec(dllexport) __stdcall int SumValue(int a, int b)
{
return a + b;
}

dllexport exports it from your dll, and __stdcall is the calling convention that VB accepts. _cdecl is the default calling convention therefore if you just simply exported your function from the DLL and used it in VB, you program would probably crash.

In you VB program, at the top of the file that you would like to call this DLL, you will need to make this declaration.

Declare Function SumValue& Lib "yourdll" (ByVal a as Integer, ByVal b as Integer)


After this you should be able to use your function in VB.
GeneralRe: Compiled .dll in C++ for use in VB Pin
David Wengier13-Feb-02 18:37
David Wengier13-Feb-02 18:37 
Questionhow do we fix this? Pin
13-Feb-02 15:43
suss13-Feb-02 15:43 
Answerwe can only use string.h and iostream.h Pin
13-Feb-02 15:46
suss13-Feb-02 15:46 
GeneralRe: we can only use string.h and iostream.h Pin
13-Feb-02 16:04
suss13-Feb-02 16:04 
AnswerRe: how do we fix this? Pin
Derek Waters13-Feb-02 17:20
Derek Waters13-Feb-02 17:20 
AnswerRe: how do we fix this? Pin
Kashif Manzoor13-Feb-02 22:19
Kashif Manzoor13-Feb-02 22:19 
GeneralAgain a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 15:26
Mr.Freeze13-Feb-02 15:26 
GeneralRe: Again a callback question... m(__)m Pin
David Wengier13-Feb-02 15:33
David Wengier13-Feb-02 15:33 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 15:54
Mr.Freeze13-Feb-02 15:54 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 16:28
Lim Bio Liong13-Feb-02 16:28 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 17:05
Mr.Freeze13-Feb-02 17:05 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 18:08
Lim Bio Liong13-Feb-02 18:08 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze13-Feb-02 19:15
Mr.Freeze13-Feb-02 19:15 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong13-Feb-02 22:58
Lim Bio Liong13-Feb-02 22:58 
GeneralRe: Again a callback question... m(__)m Pin
Mr.Freeze14-Feb-02 13:17
Mr.Freeze14-Feb-02 13:17 
GeneralRe: Again a callback question... m(__)m Pin
Lim Bio Liong14-Feb-02 20:54
Lim Bio Liong14-Feb-02 20:54 
GeneralRe: Again a callback question... m(__)m Pin
Joaquín M López Muñoz13-Feb-02 21:15
Joaquín M López Muñoz13-Feb-02 21:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.