Marshling problem???

Hi,
I have two apps., a server and a client.
Client sends query to the server and server executes it thru OLE DB classes.
Now I want to pass the CRowSet pointer back to the client, how can I do this.
Waiting for reply...
Thanx in advance for help
MoinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WynCommented:
You can simply define your user-message in proxy and do coresponding chroes.
E.g:
if client call function a of crowsel.

crowsel->a,
then in your client proxy,
sendmessage(...wm_calla);

in the stub:

case wm_calla:
crowsel->a();


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WynCommented:
o? answer? sigh!
0
WynCommented:
You can not really pass pointer between process.

if you client and server in the same process:
use CoMarshalInterThreadInterfaceInStream and
CoGetInterfaceAndReleaseStream.
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

WynCommented:
but these two function require pointer as interface and pass between threads,for you case ,you have two chooses: wrap it as an interface or use user_message in your program to simulate.
0
WynCommented:
but these two function require pointer as interface and pass between threads,for you case ,you have two chooses: wrap it as an interface or use user_message in your program to simulate.
0
WynCommented:
but these two function require pointer as interface and pass between threads,for you case ,you have two chooses: wrap it as an interface or use user_message in your program to simulate.
0
WynCommented:
sorry for these mutil-mess.
0
MoinAuthor Commented:
Please explain in detail.
Thanx
0
WynCommented:
Moin,I dont know your code but here is a way.If you need more ,please put your problem in detail.

So,your server is .exe on the same machine,right?
There are many ways.

Make it as an interface.i.e:

Delegate an interface,say CProxyRowSet to wrap the functions of CRowset and in the construction of the interface do all the chores to establish the CRowset pointer .
e.g:
Class CProxyRowSet:public IProxyRowSet
{
private:
CRowSet* m_rowset;
public:
CProxyRowSet(){//here set up the //pointer you want to pass}

A()
{
m_rowset->A() ;
.............
};
/*here delegate A() of CRowSet to interface CProxyRowSet*/
}

Then after this,you can simple let OLE RUNTIME using RPC to create the proxy and stub in between and return the pointer as common interface.When you want to pass the pointer ,just let the user query this pointer.The user can treate and use it as a real CROWSET POINTER.
Best Regards.
Wyn
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.