Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling com object from isapi filter on windows 2000 ser
Message
From
10/05/2004 11:51:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00902420
Message ID:
00902458
Views:
22
Hi

We are having some problem maybe you can help us again. We use microsoft VISUAL C++ version 6 and we have the following error about ImyclassPtr when we try to compile the code.

/*
D:\CPP\testmichel\testmichel.cpp(28) : error C2065: 'ImyclassPtr' : undeclared identifier
D:\CPP\testmichel\testmichel.cpp(28) : error C2146: syntax error : missing ';' before identifier 'pmyclass'
D:\CPP\testmichel\testmichel.cpp(28) : error C2065: 'pmyclass' : undeclared identifier
D:\CPP\testmichel\testmichel.cpp(30) : error C2228: left of '.CreateInstance' must have class/struct/union type
D:\CPP\testmichel\testmichel.cpp(34) : error C2227: left of '->myeval' must point to class/struct/union
*/

Our code


/*#include "windows.h"*/

#import "d:\temp\test.tlb" //use the full path to the server tlb

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
using namespace test; //use the myserver namespace
ImyclassPtr pmyclass; // declare a smart ptr to the server
CoInitialize(0); // initialize COM
pmyclass.CreateInstance("test.test"); //create an instance
_variant_t myvar, vresult; // declare 2 variant variables.
_bstr_t res; // declare a bstr variable
myvar = "version(1)"; // assign the variable
vresult = pmyclass->myeval(); //invoke the method
res = vresult.bstrVal; // get the Unicode result
MessageBox(0,(char *)res,"",0); //show it
pmyclass = 0; // release the server
CoUninitialize(); //uninitialize COM
return 0;
}



Thanks

Michel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform