Re: Accessing ActiveX VB function within C++ App

From: Paul Brun (pb_newsgroup_at_pbrun.net)
Date: 08/06/04


Date: Fri, 6 Aug 2004 09:48:20 -0400

I figured it out.......the function I was calling was returning something different then what I was
expecting. I worked out the differences and now everything is good.

Thanks for replying though.

Paul
  "Yamake Takahashi" <yamake92_iz@hotmail.com> wrote in message news:O5EZT%232eEHA.236@tk2msftngp13.phx.gbl...
  Try LoadLibrary(HANDLE); function.

  "Paul Brun" <pb_newsgroup@pbrun.net> wrote in message news:eF4uQNxeEHA.3632@TK2MSFTNGP09.phx.gbl...
> I have a VB function that I need to get from my C++ App, however, I have
> tried numerous
> mechanisms to access it, however, I do not get an appropriate return value.
>
> I have one function that takes in three parameters called Generate(long,
> int, int) and it returns
> a long. Here is a snippet of the code. I used the appropriate #import
> statement from my stdafx.h
> file and the DLL is available within the runtime directory. Help would be
> appreciated.
>
> HRESULT hresult;
> CLSID clsid;
> CoInitialize(NULL);
> hresult = CLSIDFromProgID(OLESTR("ProjectName.Classname"), &clsid);
> _ClassPtr *t;
>
> hresult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,
> __uuidof(_ClassPtr), (LPVOID*) &t);
>
> if (FAILED(hresult))
> {
> ...
> }
>
> long generatedMOP = t->Generate(&SysID, &agents, &nodes);
>
> t->Release();
> CoUninitialize();
>
>
>
> Assistance would be appreciated.
> Thank you
> Paul
>
>



Relevant Pages