Click here to Skip to main content
15,921,793 members
Home / Discussions / COM
   

COM

 
GeneralInternet Explorer custom menu Pin
Mohsen Saad7-Aug-03 18:55
Mohsen Saad7-Aug-03 18:55 
Generalfor people with experience with ActiveX Controls.. Pin
safee ullah7-Aug-03 1:49
safee ullah7-Aug-03 1:49 
GeneralRe: for people with experience with ActiveX Controls.. Pin
Stephane Rodriguez.7-Aug-03 6:09
Stephane Rodriguez.7-Aug-03 6:09 
GeneralRe: for people with experience with ActiveX Controls.. Pin
safee ullah7-Aug-03 23:16
safee ullah7-Aug-03 23:16 
GeneralRe: for people with experience with ActiveX Controls.. Pin
Stephane Rodriguez.7-Aug-03 23:25
Stephane Rodriguez.7-Aug-03 23:25 
GeneralRe: for people with experience with ActiveX Controls.. Pin
safee ullah8-Aug-03 0:17
safee ullah8-Aug-03 0:17 
GeneralRe: for people with experience with ActiveX Controls.. Pin
Stephane Rodriguez.8-Aug-03 0:30
Stephane Rodriguez.8-Aug-03 0:30 
Generalcalling vc6 dll from vb6 activex dll Pin
patwilliams6-Aug-03 5:53
patwilliams6-Aug-03 5:53 
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 except when I try to call a function in the vc dll from the vb dll. It works fine if I call the c++ dll from a vb exe. 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!




GeneralUsing MS Web Browser ActiveX Control Pin
Douglas Troy5-Aug-03 5:11
Douglas Troy5-Aug-03 5:11 
GeneralRe: Using MS Web Browser ActiveX Control Pin
Stephane Rodriguez.6-Aug-03 10:53
Stephane Rodriguez.6-Aug-03 10:53 
GeneralRe: Using MS Web Browser ActiveX Control Pin
Douglas Troy7-Aug-03 5:57
Douglas Troy7-Aug-03 5:57 
GeneralRe: Using MS Web Browser ActiveX Control Pin
Stephane Rodriguez.7-Aug-03 6:07
Stephane Rodriguez.7-Aug-03 6:07 
GeneralRe: Using MS Web Browser ActiveX Control Pin
Douglas Troy7-Aug-03 7:03
Douglas Troy7-Aug-03 7:03 
QuestionQueryInterface -- How come this code doesn't work? Pin
Popeye Doyle Murray5-Aug-03 4:16
Popeye Doyle Murray5-Aug-03 4:16 
AnswerRe: QueryInterface -- How come this code doesn't work? Pin
Stephane Rodriguez.5-Aug-03 5:49
Stephane Rodriguez.5-Aug-03 5:49 
GeneralRe: QueryInterface -- How come this code doesn't work? Pin
geo_m5-Aug-03 22:26
geo_m5-Aug-03 22:26 
GeneralRe: QueryInterface -- How come this code doesn't work? Pin
Steve S5-Aug-03 23:20
Steve S5-Aug-03 23:20 
GeneralRe: QueryInterface -- How come this code doesn't work? Pin
Popeye Doyle Murray6-Aug-03 2:29
Popeye Doyle Murray6-Aug-03 2:29 
GeneralRe: QueryInterface -- How come this code doesn't work? Pin
Stephane Rodriguez.6-Aug-03 3:40
Stephane Rodriguez.6-Aug-03 3:40 
GeneralActiveX - COM - for Excel Application control Pin
jauss4-Aug-03 23:20
jauss4-Aug-03 23:20 
GeneralRe: ActiveX - COM - for Excel Application control Pin
Steve S4-Aug-03 23:26
Steve S4-Aug-03 23:26 
GeneralRe: ActiveX - COM - for Excel Application control Pin
Stephane Rodriguez.4-Aug-03 23:48
Stephane Rodriguez.4-Aug-03 23:48 
GeneralRe: ActiveX - COM - for Excel Application control Pin
jauss5-Aug-03 1:44
jauss5-Aug-03 1:44 
GeneralRe: ActiveX - COM - for Excel Application control Pin
Stephane Rodriguez.5-Aug-03 1:50
Stephane Rodriguez.5-Aug-03 1:50 
GeneralATL Language support Pin
Ahmed Birry4-Aug-03 12:13
sussAhmed Birry4-Aug-03 12:13 

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.