|
Most welcome, Joshi.
- Bio.
|
|
|
|
|
Hai all,
I have two ATL Objects in my COM Server.
Their interfaces are
1) IFirstIFC
2) ISecondIFC
In my client programme I have imported the type library and
using code below
obtained the COM Object of IFirstIFC
IFirstIFCPtr fIF;
fIF.CreateInstance(__uuidof(FirstIFC));
Now my task is to obtain the COM Object of ISecondIFC.
My Question is , Is there any method for Obtaining the Interface
Pointer of ISecondFC by not calling again CreateInstance for that
Interface.
That is by avoiding this Code
ISecondIFCPtr sIF;
sIF.CreateInstance(__uuidof(SecondIFC));
That is,since both Interfaces are residing in the same COM Server,
Can I get the Interface Pointer of ISecondFC through IFirstIFC.
Thanks
George
|
|
|
|
|
A COM server is a COM object. This means that you actually have two servers.
They may be located in the same file, but that's another thing.
You cannot get an interface to an object without creating it.
My suggestion:
You could have the first server implement an interface method that will create the second server and by that you can avoid calling CreateInstance() from your client, but you would still have to call CreateInstance() from your first server in order to create the second one.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hai Roger,
I got it. Thank you very much.
I have another Doubt.
Is all COM communications(between COM Server and Client) happening
through RPC. Bcz, I have seen RPC header files such as "rpc.h"
"rpcndr.h" in both the COM Exe and COM Dll.
Thanks
George
|
|
|
|
|
georgekjolly wrote: Is all COM communications(between COM Server and Client) happening through RPC
No.
The most common way is to create an in-process-server running in the same thread, i.e. a single threaded apartment (STA). In this case every call to the server is exactly like an ordinary function call.
Remote Procedure Call (RPC) will be used when you're marshalling interfaces between multiple threads.
To get a deeper understanding of marshalling and RPC I suggest you read Lim Bio Liong's excellent article serie starting here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi Sir,
Thank you very much for your help.
Regards and Thanks
George K J
|
|
|
|
|
After i have created a services in c# using the processservices class, this services contain only a method GetDate().
but can any body tell me how can i interacte with this sevices. for example, i should have a method instead of GetDate (): Establishconnection(param..) that help me to connect to an Sql2005 server (this method is with the services). And after, i should connect to this services from a client application and call this method and then get the connection with the SqlSever without having an sqlclient in the client machine.
regards, bye.
etretyertyery
|
|
|
|
|
Help !!!!!!!!!!!!!!
1. I use C&WinAPI
2. to show a dialog to select file, but you cannot manipulate it
my imagine :
1. use openfile dialog and hide the right key menu
2. i know a dialog in VB, right of the dialog is a editbox show directory list, when you select any folder in that, the left side show a file list of that folder, but it is ocx, how can i invoke it?
so, how can i do for each way. and are there any other simplest way ?
|
|
|
|
|
I got this error from command prompt
DOS/16M: [2] not a DOS/16M executable 'C:\ASMM77\ASMM77.EXE'
How i can solve this error?
Thank You.
|
|
|
|
|
Maybe the guys of [Operating Systems / SysAdmin] can help you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I use a third part COM API lib. I need to pass an array of double to a method which accept VARIANT*, Is there any simple way to cast from double* to VARIANT*, I don't want to create a VARIANT array and copy each double value into it.
|
|
|
|
|
Search for SAFEARRAY on this site.
Prasad
MS MVP - VC++
|
|
|
|
|
Does anyone know if there is a mechanism by which you can convert/format an HRESULT value (say 0x80004005) to a human readable equivalent (in the case of the example 0x80004005 = "E_FAIL")
Obviously I could create a static map of HRESULTS to Message Text, just wondered if there was a pre-existing way to do it?
- "I'm not lying, I'm just writing fiction with my mouth"Phil Harding. myBlog [^] | mySite [^]
|
|
|
|
|
FormatMessage will convert to the 'user-friendly' error message. It's not that user-friendly, of course, because the message is necessarily generic. The English message text is given in WinError.h , in a comment above the definition of the message constant.
Be aware that errors with codes 0x8004nnnn are relative to the COM interface you used (4 is FACILITY_ITF ) and will have different meanings for different interfaces.
I'm not sure if FormatMessage will directly handle error codes in the 0x8007nnnn (FACILITY_WIN32 ) range, which are mapped from the Win32 error codes below 65536 (using HRESULT_FROM_WIN32 ).
|
|
|
|
|
You're not thinking about ::FormatMessage() , are you?
It would give you the string "Unspecified error." for the error code E_FAIL .
But you want the string "E_FAIL", right?
If your answer is 'yes' I don't think there exist such a mapping between a C++ identifier and a string. At least not any I know.
But it does however make me question if the string should be considered "human readable"...
If I really needed that I would parse <winerror.h>.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Hi,
I want to know what is the use of "extern C" in the following code snippet from a header file:
extern "C"
{
// {CA76604A-8402-472b-B115-138BAF2178BF}
extern const IID IID_IX =
{ 0xca76604a, 0x8402, 0x472b, { 0xb1, 0x15, 0x13, 0x8b, 0xaf, 0x21, 0x78, 0xbf } };
}
Vinod.C.S
|
|
|
|
|
Specifies C linkage instead of the C++ one.
see [^] and [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
But here v can see no functions only constant varibles .
Is the function rule applies to variable name also?
Vinod.C.S
|
|
|
|
|
Vinod CS wrote: Is the function rule applies to variable name also?
Yes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi folks,
I've built an ActiveX control successfully, can view it in OleView, it's working fine.
I'd like to embed it in an HTML web page. Obviously, users that don't have this installed will need to run my MSI installer program that registers the ActiveX control, writes some things to the registry, etc. How do I tell the web page to use my MSI installer if the user doesn't have the ActiveX control already installed?
|
|
|
|
|
I have a dll written in C++ running in a Linux machine. Now i want to move that dll to a Windows system and use it with a Windows application.
How can i do that?
Can you please tell what all are the performance issues i face?
What all are the dependencies?
Thanks in advance
|
|
|
|
|
- The source code needs to be made compatible across the platforms and compilers used on Linux and Windows (Boost & STL are usefull in this case and versions of it are available for Win/Linux compiler environments)
- Platform specific APIs need to be conditionally compiled (to retain the same code base across environments) or replaced
- On Windows you'll need to write some DLL module code (DllMain mostly) and expose your codes functions as DLL exports (decorate a function with __declspec(export) or use the .DEF file method)
- Compile the code and link as a DLL (library)
- "I'm not lying, I'm just writing fiction with my mouth"Phil Harding. myBlog [^] | mySite [^]
|
|
|
|
|
please help me to get the code of Ant on a Chessboard .....
|
|
|
|
|