|
I am writing a Windows NT Service based on a MFC EXE with VC++ 6.0. This windows service should use Automation (COM) to read data from a server application every minute.
MFC EXE always worked.
But if I run my windows service which has the same function like MFC EXE from Service Management Control. I always get the exception: CreateDispatch returning scode = CO_E_SERVER_EXEC_FAILURE ($80080005).
Why it doesn't work when it is a windows service? What could be the cause ? How to resovle it?
|
|
|
|
|
Intro: Hey. I am a VB6 and VB.NET programmer with little experience outside these environments.
Question:
I am about to start developing a developer tool which is delivered as a DLL. The developer must then inherit from objects in my DLL. This is easy to achieve using .NET but then my target developers must also be using .NET. If I enable COM in my DLL then I enlarge my target market a bit, however I would like to include C++ (unmanaged) developers and perhaps even LINUX and MAC developers in my target market. Is there a language/environment combination in which I might be able to manage this?
I have looked at the Qt platform but I don't know how I would enable object inheritance from a Qt DLL. I also can't find out how (unmanaged) C++ applications can consume COM (or .NET) DLLs.
So, to summarise:
1. I am trying to choose a suitable language/environment combination.
2. I want developers from many languages/environments to be able to use object inheritance from my DLL.
3. C++ and/or Qt may be part of the answer but I am not sure.
4. What happened to CORBA? Would that have been the answer?
Any COM or object library experts out there, please respond.
Cheers and thanks for any help.
|
|
|
|
|
I have the scenario where i need make the calls to C# APIs from ATL COM Client application and i have to pass array of IUnknown* objects.
How to achive this? Can any one help me?
Regards
Shankar
|
|
|
|
|
Hi,
I created a component and i did many QueryInterface calls on that component. Finally in the distructure i am calling Release on that component but my component is not getting released. Even i use smart pointers rather than normal pointers also my component is not getting released. Is there any way/tool available to find the reference count of a component?
E-Ramu
|
|
|
|
|
Ramu.e wrote: Is there any way/tool available to find the reference count of a component?
Nope, AFAIK. Anyway the IUnknown::Release method should return just the reference count (since you created the component then you have full control on). According to documentation [^] the value should be used for diagnostic/testing purposes only, i.e. it's exactly what you need.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am getting this compilation while passing lpszFileName which is a char[260] to GetPrivateProfileInt which accepts LPWSTR. Can I know how to typecast this inorder to avoid compilation error.
Thanks,
Venkat
|
|
|
|
|
What has it to do with COM ?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi,
If u want to convert from char to LPWSTR
like below:
L"Example" or _T("Example")
Before that Character Variable to use 'L' or _T ;
This Will convert char to Unicode Char
Regards
ArunKumar
VC++ ,COM,MFC
|
|
|
|
|
Hey guys,
I don't know much Windows programming (and my C++ is a little rusty), I'm hoping you all can give me a hand. I'm trying to instantiate an IShellMenu object (http://msdn.microsoft.com/en-us/library/bb774901(VS.85).aspx).
MSDN says to create an object I need to: "call CoCreateInstance with the rclsid parameter set to CLSID_MenuBand and the riid parameter set to IID_IShellMenu. You must first initialize the interface by calling IShellMenu::Initialize, and then initialize the menu band by calling IShellMenu::SetShellFolder."
The first step is easy enough, I'm doing this:
IShellMenu *aTest;
HRESULT aRes = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, IID_IShellMenu, (void **)&aTest);
But I'm running into trouble when I call aTest->Initialize() . More specifically, the first parameter needs to a pointer to an IShellMenuCallback object and I can't figure out how to instantiate something that implements that interface. Ideally, this is what I'd like to do:
class CallbackTestImpl1 : public IShellMenuCallback
{
public:
CallbackTestImpl1() { }
~CallbackTestImpl1() { }
HRESULT STDMETHODCALLTYPE IShellMenuCallback::CallbackSM(LPSMDATA psmd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
return S_OK;
}
};
IShellMenu *aTest;
HRESULT aRes = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, IID_IShellMenu, (void **)&aTest);
IShellMenuCallback *aCallbackTest = new CallbackTestImpl1();
aRes = aTest->Initialize(aCallbackTest, -1, ANCESTORDEFAULT, SMINIT_DEFAULT);
However, Visual Studio complains about my new CallbackTestImpl1() line claiming that it cannot instantiate abstract class. I've looked through the header file that declares IShellMenuCallback (shobjidl.h ) and can't find any other methods that I'm not implementing. Am I missing something obvious or is there a better way to instantiate something that implements the IShellMenuCallback interface?
Any help would be much appreciated!
|
|
|
|
|
You need to implement the standard IUnknown interface methods: IUnknown::QueryInterface, IUnknown::AddRef, and IUnknown::Release.
imo
|
|
|
|
|
http://www.codeproject.com/KB/shell/shellextguide1.aspx
if you refer to the url which is above , you will find the answer
good luck!
nice to meet u
|
|
|
|
|
Hi folks,
Is there a way to enumerate all the instances of a particular COM class held in memory across all processes on a machine?
I know that if an object registers itself in the ROT you can get it from there via the moniker.
But if it doesn't?
Specifically my issue here is a COM object that is created as a global variable in an Excel vba application. I have no control over the Excel app, can't ask the writers to add a macro to expose the object I'm after. So I'm left with looking for some way to enumerate all instances of that objects' class that are currently residing in memory on the machine. Is that possible or am I tilting at windmills?
|
|
|
|
|
hi all i have made a activex controll in vb6 and here is code for its properties which i want to assign value using the
Public Property Let WriteCardId(Net8ServiceIn As String)<br />
WriteCardId = Net8ServiceIn<br />
MsgBox "Card Id Property " + Net8ServiceIn<br />
PropertyChanged "WriteCardId"<br />
End Property<br />
Public Property Get WriteCardId() As String<br />
WriteCardId = WriteCardId<br />
MsgBox "Card Id Property " + WriteCardId<br />
End Property<br />
<br />
Public Property Set WriteCardId(Net8ServiceIn As Object)<br />
WriteCardId = CStr(Net8ServiceIn)<br />
MsgBox "Card Id Property " + WriteCardId<br />
PropertyChanged "WriteCardId"<br />
End Property<br />
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)<br />
WriteCardId = PropBag.ReadProperty("WriteCardId", "111")<br />
MsgBox "read Properties changed"<br />
End Sub<br />
when i access this from html page using Object Tag
<br />
<object id="SCWebWriter" classid="CLSID:key" codebase="WebWriter.CAB#version=1,0,0,42"><br />
Param name="WriteCardId" value="SCOTT" <br />
</object><br />
it does not pass values to activex as no Messagebox is shown,,tags < and > are added on param but unable to add on this editor.
Regards.
Tasleem Arif
|
|
|
|
|
Hi Friends,
I want to do some intialization work for my addin DLL for Outlook Express/Windows Mail.
I have implemented _IDTExtensiblity2 interface and all it's methods in my class, but none of it's methods like onConnection etc are getting invoked.
May anyone confirm whether _IDTExtensiblity2 interface works for non-office addins also?
If no, then kindly suggest some other means for doing intialization work for my addin.
Please help!!!
Thanks a lot in advance!
dolly,
N,IN
|
|
|
|
|
HI,
Can anyone suggest me how to approach to have a through knowledge on COM.I am totally new to this.
|
|
|
|
|
Well take a look at the MSDN articles on COM at http://msdn.microsoft.com
Also you may want to look at this article; - it is specifically to do with OLE Drag and Drop but it utilises COM, so may be a good starting point for you.
Hope this helps,
--Perspx
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
BSoD during a Win98 presentation
|
|
|
|
|
Hi Perspx,
Thanks fo the input, OLE Drag and Drop article is a bit helpfulone , but i got lost within msdn articles.
|
|
|
|
|
Yeah I was going to suggest not to look at the MSDN articles too in depth.. They're not that great to be honest.. However they're useful if you know what you're doing and need to look up class definitions etc, so use them for the future
--Perspx
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
BSoD during a Win98 presentation
|
|
|
|
|
Correct
Thanks,
Perspx
|
|
|
|
|
|
Xcellent Mike, I found at last an article which made my concept clear about COM.So now i think i can go ahead to apply it.Thanks for the valuable help.
Thanks again,
KDevloper.
|
|
|
|
|
ok heres whats wrong i have made an application that uses the rdp ocx all works well connect disconnect etc and screen appears i even set it to connect without entering the user and pass in a text box by tapping
the secure feature of the ocx
i now have one problem thwarting my advance im fairly new to programming and i unerstand it and can use 5 different languages but i am throughly confused as to how i can attach to the ocx or just know if it logged in
i want to do the following
if(rdp.onlogincomplete==true){
txt_log.text_changed blah append text blah;
ai_logic(ip_addy,user_name,pass_word);
// will perform logic for handling accounts
this is going in a published book so any help will be cited and given credit to the person that can help
this tool is going to be released in 2 months it is really a brilliant tool please aid in the design of this tool
}
or just show me how to call an event from the control i dont want it coded for me just some good pointers
i want it to append to this control that it connected succesfully after each time it does this i will call logic i create to keep track as i am writing a tool for security for rdp i will soon release
gpl i just need a little help with hooking the event as there is little or no documentation i can find with working examples
rtfm i know but im ad a roadblock so i could use some pointers
|
|
|
|
|
this is for the person who posted to this i found the even but could use some help on this
Copy Code
VOID OnLoginComplete();
Parameters
None.
Return Value
None.
Remarks
Implement this method in your event sink to receive notification that the control has completed logon.
ok it asks me to call a void function which intern returns no value so how the hell do i hook this thing to let me know it validted to terminal services?
|
|
|
|
|
Hey everybody!
I asked this question in the C# forum, but I guess this forum is the right place...
anyway, I wrote a COM visible C# dll for my application, and everything works great (Thanks to one of code project's articles of course! [Smile] )
I'm using this C# COM from a C++ application (not .Net).
The is in the error handling. Exceptions don't go through from the C# COM to the C++ (like _com_error).
Right now I'm passing a parameter that will store the error, if there is one.
So, What I want to know is, is there is a way to make the exceptions is C# be thrown back to the C++?
Thanks!!!
|
|
|
|
|
Hey gurus
Sorry, I haven't linked to COM from .net yet, so am probably gonna ask a dumb question.
I want to write a tool that links to a system we have here at work to automate some tedious tasks we have to do. The system is all VB6.
Now, I know the assembly that I need to interface with, and have copied that to my laptop (target system doesn't have VS installed on it) and set a reference to it in VS - just so that I can start to write some code and what not.
When I actually come to test it, I want to be sure that my .net app is looking at the correct location of the .dll file on the target system, as there are 3 dll's with the same name all in diffenrent places.
How do I do that - if at all?
(Sorry if this is a dumb ass question, need to get myself a good book, or read a decent tutorial!)
Cheers
|
|
|
|