|
Hi !
I have written a dll to set static ip address using wmi. i am using visual studio 2005 SP1 on windows server 2003 SP2. i have also written a server and client. the server links to the dll to provide the service for the client. when the client asks to set an ip for the first time...the code works fine...but the second time it crashes showing up an access violation error. I have posted the call stack below...pls help me in this regard ! thank you !
ole32.dll!CCache::GetElement() + 0xb2 bytes
ole32.dll!CComCatalog::GetClassInfoInternal() + 0xfd bytes
ole32.dll!CComCatalog::GetClassInfoW() + 0x22 bytes
ole32.dll!GetClassInfoFromClsid() + 0x2d bytes
ole32.dll!LookForConfiguredClsid() + 0x2f bytes
ole32.dll!ICoCreateInstanceEx() + 0xae bytes
ole32.dll!CComActivator::DoCreateInstance() + 0x2f bytes
ole32.dll!_CoCreateInstanceEx@24() + 0x23 bytes
ole32.dll!_CoCreateInstance@20() + 0x39 bytes
0112a6fa()
ntdll.dll!_RtlAllocateHeap@12() + 0xe2 bytes
ntdll.dll!_RtlpCoalesceFreeBlocks@16() + 0x96 bytes
010cef10()
ntdll.dll!_RtlAllocateHeap@12() + 0x50b bytes
ntdll.dll!_RtlEncodeSystemPointer@4() - 0xd7dc bytes
ntdll.dll!_RtlValidateUnicodeString@8() + 0x60 bytes
|
|
|
|
|
I inadvertently found the same post at Egghead Cafe[^] when GOOGLING, as I had never heard of your problem before. Your other post is much more descriptive, you state "Some times i also run into stack overflow and heap corruption exceptions. These errors occur in the IPHLPAPI function call getadaptersinfo() or getadaptersaddresses().
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at GetAdaptersAddresses(UInt32 , UInt32 , Void* , _IP_ADAPTER_ADDRESSES_LH* , UInt32* )"
When i GOOGLED GetAdaptersAddresses Function (MSDN)[^], I noticed this information: "Note that it is possible for the buffer size required for the IP_ADAPTER_ADDRESSES structures pointed to by the AdapterAddresses parameter to change between subsequent calls to the GetAdaptersAddresses function if an adapter address is added or removed." I would think that if you are using EXACTLY the same code for each call to set your IP Address, that this would be a problem (but, I wouldn't think it would produce a System Access Violation Exception).
The error in your original post, you identify as: "most of the times the exception occurs in the ole32.dll!CCache::Flush() function". This would drive me nuts, too. I doubt if that is actually the cause of the failure (my psychic debugging sense is telling me this), but, frankly, I don't know what to suggest.
I would contact Microsoft support, or one of their engineers that maintain a public blog, it's an interesting question.
|
|
|
|
|
I have created an Aggregate COM.
How to use the Aggregate COM object in client application?
|
|
|
|
|
I have created my own event class, publisher, and subscribers in C# .NET The event class and subscriber definitions exist in the same library. The publisher is a stand alone app which references this library. The subscriber is a windows service which also references this library.
In the windows service subscriber, I am able to receive normal COM+ events such as ApplicationEvents, ActivityEvents, etc etc, but I am having trouble receiving events from my own event class.
I am getting the exception: System.Runtime.InteropServces.COMException(0x80040201): An event was unable to invoke any of the subscribers.
My subscription code is:
ICatalogObject subscription = (ICatalogObject)transients.Add();
subscription.set_Value("Name", this.ToString()); // name it
subscription.set_Value("EventCLSID", GetEventClassID());
subscription.set_Value("InterfaceID", GetEventInterfaceID());
subscription.set_Value("SubscriberInterface", GetIUnknown());
bool success = transients.SaveChanges() == 0;
I have registered the library containing the event class with gacutil and regsvcs etc, but I can't receive events. The publisher application is listed in the Component Services viewer aswell -- it shows that the publisher app is using my event class.
Can anyone help me? I'm stuck
|
|
|
|
|
Hi Helper,
can you please. le mw know.
Is is really possible to make the ATL COM component embedding the active x (.ocx) inside it.
If yes can you please provide me the steps to do so.
I have an assignment . to make the ATL COM component with embedding the .ocx.
Here is the brief of the requirement.
I am having on e.ocx provideed by the vendor say as scanner.ocx.
What is need to do is make one another ATL COM or active x using this .ocx file. This componet which I am creating also support one dialog and should be all the controls( like buttons combo, I mean all the user interface,)
How to do that.
we need to make ATL COM or use the active x wizard for that.
can you please let me know the steps do so. It's urgent.
Thanks,
|
|
|
|
|
I create C# console application that use outlook to open msg file.
The application work well on server when I use remote desktop.
But when I try to run the console application from ASP.NET page. GetActiveObject() cannot find outlook instance.
What should I adjust/setting something to make the application work ?
Is it possible to GetActiveObject() in this situation ?
|
|
|
|
|
Hi,
I have a vc++ application that has an interface IMyInterface and a class derived from this interface.I would like to pass a pointer to this interface, to an interface method declared in a component. I am trying to manually edit the header files and .idl file in order to declare the pointer to the interface declared in vc++ application.
What I did is, I have included the vc++ app interface header file in the .idl file. I don't whether I can do this or not. But I am trying...When I did so, I am getting error "error MIDL2025 : syntax error : expecting a type specification near "virtual".
Please let me know as how to pass my interface pointer to a method in the component and what are the changes that are to be made.
Thanks in advance.
Taruni
|
|
|
|
|
You can #include a .h file in MIDL to add structs etc, but in your case I think you need to #include the .idl file with the definition of the interface you want to pass e.g.
#include "IMyInterface.idl"
usually this is after the
#import oaidl.idl
#import ocidl.idl
Your interface should then have a method (or similar):
HRESULT PassMyInterface([in] IMyInterface* pIMyInterface);
|
|
|
|
|
Hi,
I'm using visualstudio6.0 and new to the COM. I want to create a mime filter such that i can able to retrieve the web page content and replace it with other data. Please, help me.
How I have to start creating a plug-in?
I have gone through this link (i.e., http://msdn.microsoft.com/en-us/library/aa767916(VS.85).aspx), but unable to understand it clearly.
Thanks in Advance...
|
|
|
|
|
Hi
Can anyone here tell me how can i implement these Interface in C#,I am creating an com component and i need to impliment these.
IPersistProperty
IPersistPropertyBag
Pleas help me u can also give any article regarding this.
thank you
Mahammadhusen
|
|
|
|
|
Hi,
Can anybody provide me links for how to create and deploy COM, DCOM in remote servers and accessing them using VB code located in remote server.
I would be very much thankfull to all of who tried to support me in anyway.
If links explain with sample codes, it will be very much helpfull.
Thanks a Lot,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hello everybody,
I have an issue while working with COM Out-Of-Proc Servers.
My situation is such that, the client need to pass a Function pointer
to the Server, so that the server can fire callbacks at regular intervals.
So I need to define one of opearions in the interface provided by the Server to
take one function pointer.
Now the problem is that while doing so in IDL file, MIDL doesn't allow me and throwing errors.
Please help me guys...
Thanks in Advance..
Shyam
|
|
|
|
|
I think you can use connection points to fire the reply back to the client. The event sink at the client side can hold the function pointer. When the fired reply reaches the event sink of connection points you can re-direct it to the corresponding function.
|
|
|
|
|
ConnectionPoints are one method. What MIDL will allow is to pass an interface pointer tather than a finction pointer. Then you can call a function of that passed interface from the server.
Have the client implement an interface with the callback function and the server an interface with a method that takes a pointer to the first interface as a parameter. Then in the client internally QueryInterface for the interface and pass it to the server.
|
|
|
|
|
Thanks Jonathan for your reply...
That really eased my problem..
|
|
|
|
|
Hi, I have searched around the web and all my reference books but have yet to see an example of how this is done, or even if it can be done.
Here is my dilemma:
I have some old legacy apps that were written in VB6. Yay. Despite the fact that the VB6 programmers never used Object Oriented Programming of any kind... for some reason in this case they decided to nest the Procedure I need inside a class. Because of some poor programming practices that our team insists on following, I am prohibited from creating a strong reference to this COM Dll, I have to use PInvoke. So How can I use PInvoke to reference a method when it is a member of a VB6 class? The entry point is not recognized since an instance of the class would need to first be instantiated in order to access the method. Here is a sample of what my DllImport looks like:
[DllImport("SomeCOMDll", EntryPoint="aVB6Function")]
public static extern Recordset AVb6Function([MarshalAs(UnmanagedType.BStr)]
string globalIdentifier,
[MarshalAs(UnmanagedType.BStr)]
string webUser_ID,
DateTime shipDate,
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
string[,] origDestArray,
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
string[,] wtClsArray,
[MarshalAs(UnmanagedType.BStr)]
string mode,
[MarshalAs(UnmanagedType.BStr)]
string svcLvl,
[MarshalAs(UnmanagedType.BStr)]
string IOT,
[MarshalAs(UnmanagedType.BStr)]
string custCode,
[MarshalAs(UnmanagedType.Currency)]
decimal fuel,
[MarshalAs(UnmanagedType.Currency)]
decimal addtMarkupPct,
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
string[,] webAccChgArray);
"We are men of action; lies do not become us."
|
|
|
|
|
I am using VisualStudio6 and fairly new to COM.
I am using connection points for recieving reply from a server. The issue is client is waiting for the reply. Since, event are like windows messages, the client will not recieve the events fired from server if
dwReturn = ::WaitForSingleObject( m_hSynEvent , INFINITE );
is called . Please provide a solution for recieving the events.
Thanking You in advance.
|
|
|
|
|
Hello merina2005,
You can use ATLWaitWithMessageLoop(). However, there is a design flaw with this function : there is no timeout parameter.
I have written a function that waits for an event that also times out when required. Email me if you want it. My email address is :
bio_lim_2004@yahoo.com
Best Regards,
Bio.
|
|
|
|
|
Hi;
ATLWaitWithMessageLoop() allows other window messages to be dispatched while waiting. I want my GUI to wait(ie, not to process any windows message)until the reply is obtained. Do Help.
Thanking You in advance.
|
|
|
|
|
>> I want my GUI to wait(ie, not to process any windows message)until the reply is obtained...
This is v strange. If your GUI does not receive any windows messages, then it will be totally fixed on the screen and immobile. It will not receive any WM_PAINT messages and so covering it and then uncovering it will not cause it to repaint its client area. It will not even respond to any mouse click and drag.
But if this is really what you want then you should go ahead and use WaitForSingleObject(). The effect will be as you desired.
But I must be missing out on something here. Maybe you have not explained yourself fully.
- Bio.
|
|
|
|
|
In the case od STA application, the event fired using connection point will not be recieved if we use WaitForSingleObject(). I have fixed this issue by using CoWaitForMultipleHandles(). In this case, pending events are processed after obtaining the reply from connection points.
Thank You for your updates.
|
|
|
|
|
Hi,
I have a server which is used for windows 2000 advanced server. This server i have created a asp.net application to read excel sheet and update the data into the database.
I want to add permission for ASPNET for MS Excel Application. But it does not listed on DCOM Config properties.
How can i add/migrate MS Excel Application to DCOM Config properties?
It is urgent to update for my project.
Thanks in advance
|
|
|
|
|
It's under there. Add ASPNET to local launch and activate permissions. With Excel 2007, I found it necessary to login as ASPNET user using a program called anup(gets ASP.NET encypted password), logging in as ASPNET user, and then clicking OK on dialogs which popped up in order for interop automation to work from ASPNET user account.
|
|
|
|
|
|
Hey,
i've written a ActiveX-control using MFC. The control creates a CWnd which hosts a CListCtrl. All works fine, in Ms Testcontainer but not e.g. in Ms Access/Excel. When I use a form in Access and place my control on the form, no key events reach my control (even if the control has focus). All mouse-events works well. How can I send the keystrockes to my control (eg. move cursor on my listctrl)?
Thank you for helping me...
|
|
|
|