|
I have ATL COm dll, Now I want to convert it to ATL EXE, But when I removed the DLL main stuff to Winmain... It still assumes, its dll. When I try to execute it on cmd-shell, it gives me error messsage, " Not valid Win32 application"
Any Soultion.
cheers
Balkrishna Talele
|
|
|
|
|
Hello Balkrishna,
There is no direct way to convert a COM DLL to a COM EXE. While the implementation codes of your objects will most likely remain the same, the server codes (i.e. the supporting global functions that help to expose your COM objects) are entirely different between a COM DLL and a COM EXE.
A DLL will typically export a DllGetClassObject() global function plus others (e.g. DllCanUnloadNow()). A COM EXE cannot export any functions and must use the CoRegisterClassObject() to expose your COM Object's Class Factory Object.
I suggest you refer to a good book on COM, e.g. The Essence of COM by David S. Platt.
|
|
|
|
|
Hi,
as far as I know a C++ com client needs the interface definition and GUIDS of the server which are taking from xxx.c and xxx_i.c.
my question is: how can I generate xxx.c and xxx_i.c files from a tlb or dll ?
Thank you in advance
|
|
|
|
|
I obtained the idl from Ole/Com Object Viewer. Then I compiled it with midl.exe, thus getting the xxx.h and xxx_i.c
|
|
|
|
|
Hello Fisico,
What is typically done is that you would use the .NET tool regasm.exe to register COM information for your C# assembly. You can also instruct regasm.exe to produce a .TLB (type library) file for the assembly by using the /tlb option, for example :
regasm CSharpAssembly.dll /tlb
You would then use this .TLB in the C++ client source code via a #import statement :
#import "CSharpAssembly.tlb"
The full definitions of the COM object available to your C++ client will be available via an automatically generated .tlh (type library header) file.
Best Regards,
Bio.
|
|
|
|
|
I've been reading for days now and I'm sure the answer is simple, but I'm just missing it.
In application myClient I create an instance to application myServer. Now myClient needs to create a linked list of data that myServer will process. How do I declare the method in myServer to receive a pointer to the link list?
I'm assuming that because myServer is out of process I need to use the CoTaskAllocMem to allocate the memory for my linked list. But I'm not sure how to pass that pointer. Is it as simple as just casting it to a Variant?
Thanks for your patients.
|
|
|
|
|
mtwombley wrote: How do I declare the method in myServer to receive a pointer to the link list?
Simply: You cannot without writing the marshalling code for it by yourself. (Complex warning!)
This is due to the fact that the out-of-process server is just that, out of the process and hence executes in another address space.
If you are using an interface that uses the universal marshaler, i.e. it has the 'oleautomation' attribute in the .idl-file, you are limited to the data types that are supported by that marshaler.
If this is the case I suggest that you pack your linked list into a multi-dimensional SafeArray of VARIANTs where each VARIANT contains a SafeArray of VT_UI1 that represent the data of an element in your linked list.
This is similar to providing binary data to the server and you have to develop some kind of 'protocol' of how to interpret the binary data in the server so that it can rebuild the linked list.
Another way is to pass one element in your list for each call to the server in a SafeArray of VT_UI1 where you have to use the same 'protocol' as above for unpacking the list element data.
Since the server is out of process, this way could be a performance issue. If the list contains a lot of elements this could really slow things down, but if the list is rather small this way is easier to write the code for.
That's for you to decide.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
I want to subscribe to SENS network events (using ISensNetwork) from a COM DLL. Microsoft has a good example for subscribing to the events from a COM EXE, but i don't know what I need to do (what/where/when) in order to get it running from a DLL (I only want the code to run in response to an event).
Can any-one point me in the right direction?
|
|
|
|
|
hello
In my mfc vc6 program, I COM connect to msn messenger sink via advise and also can disconnect with unadvise. All is well and I can control MSN very well.
However, if in taskmgr you kill MSN IM, how does my program detect if its connection is "lost" with msn IM (since it was killed) and if so detected, doing an unadvise wont work for the msn sink is now gone.
Any adive?
Thank you
|
|
|
|
|
I'm trying to create a ActiveX DLL in VisualStudio C++ 6.0
I want to use this with an IIS-Server to make a SOAP-Communication. I use the SOAP Toolkit 3.0!
I have to create a DLL like the following example:
>>
The following procedure creates a Microsoft® Visual Basic® ActiveX® DLL that implements the various operations: EchoString, AddNumbers, and SubtractNumbers. If you were to create this DLL on a computer other than a server running IIS, you would need to copy it from that computer to a server running IIS and also register the DLL on that server.
To create the DocSample1Service DLL
Open Microsoft Visual Basic® and create an ActiveX DLL project.
Change the Project Name to DocSample1Service and the Class Name to Sample1.
On the Project menu, click DocSample1Service Properties. Then, on the General tab, select the Unattanded Execution and Retained In Memory options. For more information see, Developing SOAP Toolkit Applications.
To the Sample1 class, add the code from the Code Listing for the Sample1 Class.
Save the project in the Soap3DocSamples\DocSample1\Server folder.
On the File menu, click Make DocSample1Service.dll. Save the DLL in the Soap3DocSamples\DocSample1\Server folder.
<<
|
|
|
|
|
Hello,
I am developing Shared Add-In for MS office in VS .Net 2005.It works on my computer in debug mode and also after installing it using the setup of project.When I install the application on other computer (does not contain VS .NET 2005) it seems like it not installed at all,no effect.
.Net framework 2.0 installed
Updates for office installed
If someone has any suggestions,it will realy help me because now the project is stocked.
Prefferable to the mail: caesar_zav@hotmail.com
|
|
|
|
|
Iam using mshflxgd.ocx in my ASP project. it works fine on the machine where VB6 Activex Controls are installed completly, but when i try to register the mshflxgd.ocx and its dep files manualy using regsvr32.exe, it simply doesnt work. the grid appears as big box with a image at teh left top corner. plz give me a solution.
bala
|
|
|
|
|
hi all
my task is on connecting UPS to PC and iam trying to do it by means of WMI (windows Management Instrumentation).
Can anybody please help me in writing Eventconsumers(event notifications) for WIN32_UninterruptiblePowerSupply Class
Thank you
abhi
abhi
|
|
|
|
|
I have one Singleton COM Server which is launched by the windows service. In antother aplication i want the interface pointer of the Singleton COM Server.(Both are in single machine). In this case instead of getting the existing Singleton COM Server pointer its creating a new instace. Whenever we declare a COM Server with DECLARE_CLASSFACTORY_SINGLETON macro. It will create a one instance on the local machine. Any body plz suggest some possible ways to overcome this problem
Srinivas
|
|
|
|
|
Hello,
I need the updated WUA header files from M$ for a project.
(http://msdn.microsoft.com/library/en-us/wua_sdk/wua/updating_windows_update_agent_header_files.asp)
Unfortunately are the links on their site broken.
Where can I download the file wua_api_headers_i386.EXE?
And can somebody help me with code snippets for beginning with the WUA api?
Please.
Thanks.
Amd Opteron
|
|
|
|
|
In VS 2003 one may find two different looking web browser controls. One from .NET named the AxWebBrowser1 and the other thru' the interop via COM. What is the purpose of this second one whose object name is WebBrowser? Can this be used together with MSHTML for some application? This one has no visiblity except its availability thru code. I am interested in knowing whether it was included to the C++ developers or does it have any other utility.
|
|
|
|
|
I am new to COM technology.
I am tryimg to write my first componant but it gives error.
i.e error in loadimg library file
Pl'z go through the code........
I gave proper address of unknwn file ,still it gives error.
#import "unknwn.idl"
[
object,
uuid(C21D0200-2FB6-11d2-8952-444553540000),
helpstring(“Car driving”)
]
interface ICar : IUnknown
{
HRESULT SetSpeed( [in] long nSpeed );
};
[
object,
uuid(C21D0200-2FB6-11d2-8952-444553540000),
helpstring(“Engine control”)
]
interface IEngine : IUnknown
{
HRESULT Start();
HRESULT Stop();
};
[
uuid(310C97F4-3ABE-11d2-915E-52544C004D83),
version(1.0),
helpstring(“Car library 1.0”)
Distributed Computing Topics
PART V
816
]
library YourLib
{
importlib “stdole2.tlb”
importlib “stdole32.tlb”
[
uuid(310C97D0-3ABE-11d2-915E-52544C004D83},
helpstring(“Car class”)
]
coclass Car
{
[default] interface ICar;
interface IEngine;
};
};
Yuwraj
|
|
|
|
|
Yuwraj,
please note that messages posted in these forums are coming from real persons and not compilers. Hence do not post messages that are kind of the-following-code-contains-errors-please-find-them without any explanation.
Describe the error, what environment you are using and what you are trying to do and then, maybe, someone can provide you with some help.
The more information you give about your problem, the more detailed help you can be given. This is also why your post has not been answered earlier.
Now, about your code...
Both IEngine and ICar have the same UUID in the code snippet you posted.
If this doesn't help you, post some more information about what errors you get when you're building.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
LIBID and CLSIDs are equal too. Not that I think that will mean any problems. The two IIDs will however.
|
|
|
|
|
Hello Yuwraj !
When I objserved you code, I found two things :
1. you put same IID for both the interfaces
2. same ID for class and library.
But actully all these are to be different. so, put different IDs for all the elements...
- Malli...!
|
|
|
|
|
Hi
I try to write an Web Application on wich you can draw some
lines using the inkobj.dll.
In ASP.net, no Problem. You have to create an Windows.Forms.Control wich
you can call from an <object> Tag in your ASP.net Webapp.
I just want to know if it's possible to draw some lines using
classic ASP and the COM Object.
Some Code:
<br />
var oInkColl = Server.CreateObject("MSINKAUT.InkCollector");<br />
oInkColl.hWnd =
I think hWnd needs an Form Object.. How can I say that the Window is the IE?
I that possible?
|
|
|
|
|
Has anyone worked with the Ericsson Solidus COM?
|
|
|
|
|
please help me:
i have to create an extension for thunderbird not for firefox so i want tutorial for how to create extension and use this.
reply me ASAP.
Bankey Khandelwal
Software Engineer
bankey.khandelwal@solversa.com
|
|
|
|
|
I get this message when I use mshtml in vb.net. I am trying to declare a variable doc as New mshtml.HTMLTextElement
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in test.exe
Additional information: COM object with CLSID {3050F4BA-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered.
I find the CLSID in Googles' folder in HKEY_USERS with the same qualification, that is:
CLSID {3050F4BA-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered.
Could it be Google's search somehow getting into the registry?
Any clues? hints? suggestions? links?
|
|
|
|
|
Hi,
I have two questions :
1) How would you create a singleton ATL COM Class? (Like when you do a CoCreateInstace for the interface, you always get the same instance of the class)
Right now I did a work around of declaring all the data as static variables.
I also read about a macro called as DECLARE_SOMETHING_SINGLETON (Not sure about the correct name)
2) I also have some global functions in the same COM Class. These global functions need to access the COM Class member functions. So the global functions need to access only the single instance of this COM Class at any cost. My COM Component is an Out-Proc Win NT Service.
The global function code looks like
CALLBACK Global_Fn()
{
//call the class's function
CCOMCLASSA *pA = NULL;
pA->MemberFunA(); //this is crap piece of code, but due to static vbles, it is working as of now
}
Any ideas to do all this elegantly? All help will be greatly appreciated.
Thanks
Misha
|
|
|
|