|
hello everybody!
i habe an urgent problem!
there are 2 components i developed in Visual Studio 6 with ATL.
i used the standard wizard to create the DLL´s.
Short explaination of the 2 components:
1. Modul: Search: this dll makes a search against a data-file. it has got interface can used by the most common program languages.
2. Modul: SearchOverXML(using MSXML 4 SP2): this dll receive the parameters used for Modul 1 from a Client, receive a Object, which contains the Result from Modul 1 and the Modul 2 will write the Result-Data in a specific XML-Structur to the Client.
and now my problem. if i call Modul 2 10000 times from a client, the memory is rising and rising and if memory is out the application crashes.
i cleanup all references to MSXML and if i want to call the Release-Method on the Modul 1 Object (i forgot it at first) the Client crashes and the Memory-Leak is still there.
if i call modul 1 only, i have got no problem!
so, i dont know what to do know. maybe the implementation of Modul 2 is wrong. Has somebody a Code Example how to call a ATL Server from a other ATL Server?
thanks for help
best regards
andreas
|
|
|
|
|
Hi
I´m working on a Single Sign On system using a BHO in VC 6.0
I would like to capture the mouse clicks, and using elementFromPoint() obtain a element name, so later i could complete the data.
I think i should use put_onclick() to override the default mouse handler, but the documentation is really bad and i dont understand how to use it.
It says that the parameter is a pointer to an IDispatch interface, that implements a default mouse handler, but...
Should i create a new interfase with a method to handle the mouse events?
How should this method be named?
I would really apreciate any help
Thanks in advance
Sebastian
|
|
|
|
|
Hi.
I am creating the Outlook Object Library 11.0's application object in C++ and calling its CreateDispatch method in an MFC Regular DLL's exproted function. When i call that function from a windows application it is working fine, but when that function is called from a windows service the CreateDispatch function of the application object fails. Please tell me what is this problem. The windows service is configuered to run with a user of windows NT domain.
Here is the code
if(objApplication.CreateDispatch("{0006F03A-0000-0000-C000-000000000046}"))
{
objNameSpace = objApplication.GetNamespace("MAPI");
if(objNameSpace!=NULL)
{
isLoggedIn=TRUE;
return TRUE;
}
}
isLoggedIn=FALSE;
return FALSE;
Common Man
|
|
|
|
|
Hello, I have an swf embedded into an MFC dialog window. MFC is staically linked, Swf embed=true.
The swf appears to be compiled into the exe.
My question: Is there ANY way that someone could extract the swf from the exe?
It is very important that this is impossible, as the swf can not be unprotected.
|
|
|
|
|
can you help me the way to combine DLL and EXE files into 1 single file ? and the way to group DLL files into 1 single DLL files. I'm using .NET language.
thanks
|
|
|
|
|
Hi all,
I have written an application in which I embed powerpoint in my application using COM. But the problem is I'm getting some version dependencies in office...I'm facing some problem when I am running with different powerpoint(MsOffice) versions(Office 98,2000 or XP).
How to know to which version of powerpoint I'm linking so that I can make my application version inependent...
Plz help,
Regards,
sam.
|
|
|
|
|
Well, you have an obvious solution - write a different version application for each version of Powerpoint.
There is a more elegant approach. This is pretty complicated to even explain. You'll have to be pretty strong on COM to be able to program this effectively.
Basically since your application needs to be compatible with different versions of the PowerPoint object library, you must decouple the application from any direct reference to the object library itself. That means you need to code your application against an abstract interface definition instead of the Powerpoint library itself.
You also have to create implementation DLLs for each version of PowerPoint you support. These have to contain concrete impementation classes and be compiled against the correct version of the Powerpoint object library.
Finally, you have to create a Class Factory that determines which version of Powerpoint is installed, and registers the correct implementation DLL at runtime, then returns the concrete Powerpoint class from the appropriate DLL that implements the abstract interface definition.
You install all concrete implementation DLLs on the target machine but you do not register any of them, because only the one that matches the current version of Powerpoint on the machine will register correctly anyway.
Since the Class Factory determines at runtime which version is currently installed, and actually registers the correct concrete implmentation DLL and then returns the implementation class, if your user decides to upgrade from example Office 98 to Office 2000, then the class factory will recognize that and automatically upgrade the concrete implmentation DLL.
Like I said, elegant, but not simple.
Robert
|
|
|
|
|
Hi Robert,
Thanx a lot for ur suggestion, however ,I'm quite an amateur in COM to try out all this.....
Still I'll give it a try...
1 more question:- I want to call some COM interface functions in a separate thread.. How to do that? I called CoInitialize() and then tried calling inside the new thread...but it didn't work out...
Plz help.....
Thanks & regards,
sam.
|
|
|
|
|
Hi,
Is it possible to remove icons in the system tray, without stopping the process Ideally the function would take the process name and remove the icon. I know it can be done as I've seen tools which do it. Ideally through VBS but C++ would do as well.
I've searched plenty via Google and all I can find are articles on how to add icons
Thanks
|
|
|
|
|
no the systray only allows the process that registers itself to remove itself.
You can kill the explorer process (which is not a good option) to remove the element.
you can try to hook into the explorer process to determine where the registration section for the tray is but you would need to know what your looking for. Again is not a good option
|
|
|
|
|
I wrote a com object with ATL, it has a test function, which declared like "HRESULT test([in]byte* aaa);" ; I wrote the following code in a html file, want to call test function, but always get error message "type not match". Who can tell me is it possible to call test using VBScript and how to .
my script code:
Dim MyObj
Set MyObj = CreateObject("Test.Test")
Dim data(5)
data(0) = CByte(97)
data(1) = CByte(97)
data(2) = CByte(97)
data(3) = CByte(97)
data(4) = CByte(97)
data(5) = CByte(97)
MyObj.test data
|
|
|
|
|
VBScript is an untyped language, or more correctly all types in VBScript are VARIANT.
The problem is not in your VBScript, it is in your ATL method definition. To pass an array of any type into an ATL COM object from VBScript, you have to make several changes:
1) The parameter must be declared as [in, out] to force it to be passed ByRef instead of ByVal.
2) The parameter must be declared as a VARIANT* type.
3) You have to write additional code in the ATL function to convert the VARIANT* array into a byte array.
So, your new function definition must be:
"HRESULT test([in, out] VARIANT* aaa);"
Once you have passed the array into the ATL COM object you need to access it as a SAFEARRAY and retrieve the values as VARIANTS then cast them to bytes.
For more info see:
http://support.microsoft.com/kb/218454/EN-US/[^]
Robert
|
|
|
|
|
Hi,
I've got a COM component that needs to read/write browser cookies (the component is on the client machine and does not run in the context of an IE Toolbar or the like). Are there any API's available to do this or will I need to roll my own?
Thanks in advance,
-Robin
|
|
|
|
|
You probably want InternetGetCookie[Ex] and InternetSetCookie[Ex].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
That does the trick, thanks!
|
|
|
|
|
RCox wrote:
does the trick
sdgsdfgdgdfgdfgdfgdgd
|
|
|
|
|
How can i get cookie expiration date?
|
|
|
|
|
What is the difference between COM, ActiveX and DLL ?
|
|
|
|
|
A DLL is a Dynamic Link Library. This is a binary file, that can contain almost anything: methods, resources (menus, Dialogs, images, and so forth), and, of course, references to other DLLs.
COM is the binary standard for programatically creating components (in any language). Go to the Microsoft COM page for more information on this subject.
ActiveX is a Microsoft designation for components that are created using the COM technology.
My answers given here are vastly simplified versions of what you can find at the offocial Micorosft Site. But, they are all very important (so, read, read, read until your brain is full).
|
|
|
|
|
I've a MTS/COM+ component (COMPONENT_1) that #import s ADO library. And, I have another MTS/COM+ component (COMPONENT_2) that #import s this component (i.e. COMPONENT_1). I need to use ADO objects in my second component (COMPONENT_2) too. If I use #import in my second component, I get lots of errors. If I do not, the MIDL compiler remains unable to recognize _Recordset data type.
Or, lets say that I do not use ADO in my second component at all i.e. I use IDispatch instead of _Recordset pointers to receive recordsets. This solves the problem but gives birth to a new problem. ADO recordsets loose their current position i.e. it moves to the first record if type casted to IDispatch pointers. I dont know why.
Can anyone please show me how to do it? I am using ATL with Visual C++ 6.0 SP5.
Thanks
Gurmeet BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
|
hi!
i have tried to store bitmap image into my activex control. i used the following Put property to store image.
[propput, id(7), helpstring("property CompanyLogo")] HRESULT CompanyLogo([in] IPictureDisp * newVal);
and in it i wrote following four lines of code.
m_pCompLogoDisp = newVal;
SetDirty(true);
SendOnDataChange();
FireViewChange();
The property is receiving image data but not persisting it.
does my property declarion incorrect. if so then plz help me.
Thanks in advance.
|
|
|
|
|
Hi,
I am learning COM, please provide me some documents for Biggners.
Anil
|
|
|
|
|
http://www.codeproject.com/com/COM_from_scratch_1.asp
Just started studying COM, this one seems one of the best I found (if not the best at all).
The article requires C++ knowledge, since code it contains sample in C++.
|
|
|
|
|
Me: looking to fill Senior VC++, COM, UI programming position in NYC.
You: Fantastic programmer looking for interesting position in NYC.
Please send me a resume.
|
|
|
|