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 14:32:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00902420
Message ID:
00902547
Views:
14
Hi again

This time this is working very well. We were too in a hurry to try the code and we make a small mistake. We forgot to change IsetupPtr to ItestPtr in the following line of code that you gave this morning.

IsetupPtr psetup; // declare a smart ptr to the server

Thanks

Michel

>Michel,
>Here's some c++ code I use that's fairly simple:
>
>#include "windows.h"
>#import "c:\fox\test\myserver.tlb"	//use the full path to the server tlb
>
>int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR , int)
>{
>	using namespace myserver;	//use the myserver namespace
>	ImyclassPtr pmyclass;    // declare a smart ptr to the server
>	CoInitialize(0);			// initialize COM
>	pmyclass.CreateInstance("myserver.myclass");	//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(&myvar);	//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;
>}
>
>
>>Hi
>>
>>We try a filter(write in C++) on our web server and this is working. This filter converts HTML response data to upper case if requested by the client. On this server we create a com object and what we want to do is call this object from this filter to do some task. Is it a way to create the object and call this object from c++ code.
>>
>>Thanks
>>
>>Michel
Previous
Reply
Map
View

Click here to load this message in the networking platform