Click here to Skip to main content
15,919,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: One of us is hallucinating. Pin
Atlantys6-Aug-03 5:57
Atlantys6-Aug-03 5:57 
Generalreading in a file and storing the words in a char[] Pin
johnstonsk5-Aug-03 8:44
johnstonsk5-Aug-03 8:44 
GeneralRe: reading in a file and storing the words in a char[] Pin
canniballl5-Aug-03 9:17
canniballl5-Aug-03 9:17 
GeneralRe: reading in a file and storing the words in a char[] Pin
johnstonsk5-Aug-03 9:34
johnstonsk5-Aug-03 9:34 
GeneralRe: Windows API related problem.... Pin
Bob Stanneveld5-Aug-03 8:14
Bob Stanneveld5-Aug-03 8:14 
GeneralRe: Windows API related problem.... Pin
Maximilien5-Aug-03 8:43
Maximilien5-Aug-03 8:43 
GeneralRe: Windows API related problem.... Pin
jhwurmbach5-Aug-03 21:36
jhwurmbach5-Aug-03 21:36 
GeneralCalling VC6 DLL from VB6 DLL Pin
patwilliams5-Aug-03 7:45
patwilliams5-Aug-03 7:45 
After reading several boards, I'm close but no cigar. I have an existing C++ app that calls my vc6 dll which calls a vb6 dll. That seems to work fine but when I try to call a function in the vc dll from the vb dll. For this test, the calling vc app does a simple call to fakePlugIn().

The vc dll:

#include "stdafx.h"
#import "testvb.dll"
using namespace testvb;

extern "C" __declspec(dllexport) fakePlugIn()
{
HRESULT hresult;
CLSID clsid;
_vbdllcls *t;

CoInitialize(NULL); //initialize COM library
hresult=CLSIDFromProgID(OLESTR("testvb.vbdllcls"), &clsid);
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_vbdllcls),(LPVOID *) &t);
if(FAILED(hresult))
{
AfxMessageBox("Creation Failed");
return false;
}
t->InVbDll("string to vb dll"); //call the vb dll
t->Release();
CoUninitialize();
return true;
}

extern "C" void __declspec(dllexport) Callback(void)
{
AfxMessageBox("in callback");
}

The vb code:

Public Declare Function Callback Lib "testcpp.dll" () 'this is in a module

Public Function InVbDll(ByVal s As String) As Long 'this is in class vbdllcls
MsgBox s
Callback
End Function

With Callback defined as __declspec(dllexport), the message box in Callback gets executed but then I get a runtime error: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.

OK so I tried __stdcall instead. Then I don't make it to the Callback and get a runtime error:
First-chance exception at 0x77e73887 in cppshell.exe: 0xC000008F: Floating-point inexact result.
First-chance exception at 0x77e73887 in cppshell.exe: Microsoft C++ exception: _com_error @ 0x0012fbac.

I've tried various combinations as well with the same result. Ultimately, I'd like to pass strings into and possibly out of Callback, but one step at a time.

Any light you could shed on this would be appreciated!






QuestionHow do you add full datbase support to a dialog app after..... Pin
Terry O'Nolley5-Aug-03 6:49
Terry O'Nolley5-Aug-03 6:49 
Questionvertical scroll bar not working in MFC? Pin
mcguile2575-Aug-03 6:04
mcguile2575-Aug-03 6:04 
Questionconnected to the network ???????? Pin
si_695-Aug-03 5:51
si_695-Aug-03 5:51 
AnswerRe: connected to the network ???????? Pin
David Crow5-Aug-03 7:07
David Crow5-Aug-03 7:07 
AnswerRe: connected to the network ???????? Pin
Ravi Bhavnani5-Aug-03 9:41
professionalRavi Bhavnani5-Aug-03 9:41 
AnswerRe: connected to the network ???????? Pin
l a u r e n5-Aug-03 12:00
l a u r e n5-Aug-03 12:00 
AnswerRe: connected to the network ???????? Pin
kochhar5-Aug-03 14:43
kochhar5-Aug-03 14:43 
GeneralInstall TCP/IP Pin
Anonymous5-Aug-03 5:42
Anonymous5-Aug-03 5:42 
GeneralRe: Install TCP/IP Pin
John M. Drescher5-Aug-03 7:36
John M. Drescher5-Aug-03 7:36 
GeneralWhere is GDI+ 1.1 Pin
User 223705-Aug-03 5:10
User 223705-Aug-03 5:10 
GeneralRe: Where is GDI+ 1.1 Pin
J. Dunlap5-Aug-03 8:24
J. Dunlap5-Aug-03 8:24 
GeneralRe: Where is GDI+ 1.1 Pin
cmk5-Aug-03 8:46
cmk5-Aug-03 8:46 
GeneralCommunicating with a serial port Pin
keegan5-Aug-03 3:58
keegan5-Aug-03 3:58 
GeneralRe: Communicating with a serial port Pin
tomasvilda5-Aug-03 4:41
professionaltomasvilda5-Aug-03 4:41 
GeneralRe: Communicating with a serial port Pin
John M. Drescher5-Aug-03 8:27
John M. Drescher5-Aug-03 8:27 
QuestionHow to open a file in its designated application? Pin
gumber5-Aug-03 3:07
gumber5-Aug-03 3:07 
AnswerRe: How to open a file in its designated application? Pin
pépé5-Aug-03 3:11
pépé5-Aug-03 3:11 

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.