|
Release your interface pointer before you return.
pINextGen->Release();
Think you'll find that the problem is with your Interface object when it's being destroyed.
|
|
|
|
|
Hello Friends
I have creared one .jar file with java NetBeans.Now,i want to use this jar file functionalities in c# application.So,I want to register jar file as COM object so that i can use it.
So,is there any way to register as COM object in System Registery?
I found one way thru google is to register thru javareg.exe but I didnt found the javareg.exe.
Do you have any other Ideas?
Thanks In Advance.
Regards
Yogesh Sikri
|
|
|
|
|
Hi Guys
I found on net that we can do it through javaREG.exe tool from MIcrosoft java sdk but I am nt able to find it.
Do u guys have any idea from where I can find it or any other Ideas?
Thanks & Regards
Yogesh
|
|
|
|
|
Hi I have a C++ project as exe , I want to export some of the methods of the classes to use them in .net (C#) . I think better idea would be to create a ATL project and create interfaces and implement the methods by calling the C++ lib methods.
Is there any other way to do this , which would be fessible and efficient ?
thanks
|
|
|
|
|
Per your title, if this is a COM Server, then you already have access to that in .NET. Just open your .NET Project, right-click on References and select "Add references ...", click on the COM tab and find your COM server in the list of named objects. When you select it, Studio will automatically generate a .NET wrapper to your COM interfaces and you can use that code directly in your .NET project.
If it's not already a COM object, you can do it either way: create a DLL that you call into from your .NET project or a COM object that you reference in your .NET Project (as I just mentioned).
Not entirely certain this answers your question, if not, you'll need to provide more details as to what, exactly, you're wanting to accomplish.
|
|
|
|
|
I'm trying to write a bho to get the ocx in IE. I'm a newer to bho. I'm not famailar with com. I really need your help. Please, help me, and I will really appreciate your help!
|
|
|
|
|
Take a look at this page[^] as a good starting point.
It's time for a new signature.
|
|
|
|
|
What do you mean by "get flash handle"? Are you talking about the HWND of the ActiveX control? Be specific and unambitious.
Steve
|
|
|
|
|
Hi, thank you for your reply. I'm trying to write a bho which will be able to connect to .ocx and send message to the flash activex. I don't know which class might provide this function. Please help me, thank you!
|
|
|
|
|
What do you mean by messages? Window messages? So you want the HWND of the ActiveX control?
Steve
|
|
|
|
|
Hi, I mean to write a bho that can control activex. Thank you
|
|
|
|
|
I am facing a problem where i dont receive the MSMQ events on 64 bit machine. The same code works fine on a 32 bit server but not on 64. Below is how the Sink mapping is done.
BEGIN_SINK_MAP(CMailQueueServer)
SINK_ENTRY_EX(0, DIID__DMSMQEventEvents, 0, Arrived)
SINK_ENTRY_EX(0, DIID__DMSMQEventEvents, 1, ArrivedError)
END_SINK_MAP()
I can queue up messages but the event doesnt get fired, the items in the queue remains unprocessed. Does it have to be handled differently in 64 bit server?
Any help will be greatly appreciated!!!
Hariharan.T
|
|
|
|
|
Hi everyone,
I have a C# COM dll which I've add to my delphi application . I can access to its methods and properties successfully .but I cannot access to its events .
this is the sample C# code that I found and used:
[ComVisible(false)]
public delegate void CallArrived(object sender, string callData);
/// <summary>
/// Interface to expose SimpleAgent events to COM
/// </summary>
[ComVisible(true)]
[GuidAttribute("1FFBFF09-3AF0-4F06-998D-7F4B6CB978DD")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IAgentEvents
{
///<summary>
/// Handles incoming calls from the predictive manager.
///</summary>
///<param name="sender">The class that initiated this event</param>
///<param name="callData">The data associated with the incoming call.</param>
[DispId(1)]
void OnCallArrived(object sender, string callData);
}
/// <summary>
/// Represents the agent side of the system. This is usually related to UI interactions.
/// </summary>
[ComVisible(true)]
[GuidAttribute("EF00685F-1C14-4D05-9EFA-538B3137D86C")]
[ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(IAgentEvents))]
public class SimpleAgent
{
/// <summary>
/// Occurs when a call arrives.
/// </summary>
public event CallArrived OnCallArrived;
public SimpleAgent() {}
public string AgentName { get; set; }
public string CurrentPhoneNumber { get; set; }
public void FireOffCall()
{
if (OnCallArrived != null)
{
OnCallArrived(this, "555-123-4567");
}
}
}
and this is the Delphi Sample code which I used :
procedure TForm1.Button1Click(Sender: TObject);
var
intrf : SimpleAgent;
begin
intrf.AgentName ('Name');
end;
I'll appreciate it if anyone could show me the way to access the Event .
Best Regards,
Shialn
|
|
|
|
|
I'll give you a word or two of advice - you've posted this in the Delphi forum and again here - you'll get better help/assistance if you dont cross-post - pick a forum, stick with it - people will get narky if you post in more than one forum - if you get the forum wrong, people will guide you to the correct one
'g'
|
|
|
|
|
To some extent I can understand in this case. Help may come from either forum but most people who visit one probably won't visit the other.
Steve
|
|
|
|
|
How can i get Visual Studio to regenerate wrapper classes for an activex control? The control has updated but removing it from my project and adding it back does not generate the wrapper classes.
|
|
|
|
|
Remove existing wrapper class from your project and add new one either by adding a member variable for your control or by 'Add MFC class from ActiveX control' wizard.
|
|
|
|
|
Since removing and adding does not work for you, you could add the activex control into a new project and then take the generated files from there and replace your original files with the new ones.
|
|
|
|
|
Sounds like a reasonable suggestion.
Steve
|
|
|
|
|
Thanks for the suggestion. Do you guys have any idea why removing does not work? Do you know where visual studio keeps this info?
Thanks,
Eugen
|
|
|
|
|
I've ran into the same problem in the past. One of my co-workers told my a magic incantation that got the wrappers regenerated, but I can't remember what it was.
Steve
|
|
|
|
|
Hi,
I have a com local server(an BitManipulater.exe server) and a client.I executed two instances of client programs in debug mode.If i open the task manager in windows xp, the processes tab is showing only one BitManipulater.exe process.How com deals with local server, if lot of client are using same local server.I thought there will be two instances of BitManipulater.exe.Any explanation on this please,
Thanks in advance
venkatanarayana
|
|
|
|
|
When calling CoRegisterClassObject[^] for your class object use the REGCLS_SINGLEUSE flag (see here[^]). This should result in a separate exe per instance.
Steve
|
|
|
|
|
Hi Steve,
Thanks for the info.I am using MFC for creating com server.How i can access CoRegisterClassObject,I think object factories registration is done in COleObjectFactory::RegisterAll
Thanks & Regards,
venkatanarayana
|
|
|
|
|
It's not hard to find out. I placed a breakpoint in CoRegisterClassObject and when it was hit had a look at the stack. The MFC function COleObjectFactory::Register seems to be where the action takes place. The code in question looks like this:
SCODE sc = ::CoRegisterClassObject(m_clsid, &m_xClassFactory,
CLSCTX_LOCAL_SERVER,
m_bMultiInstance ? REGCLS_SINGLEUSE : REGCLS_MULTIPLEUSE,
&m_dwRegister);
Note the that the m_bMultiInstance member seems to be exactly what you're looking for. When I searched MFC's source for it I found this:
void COleTemplateServer::ConnectTemplate(
REFCLSID clsid, CDocTemplate* pDocTemplate, BOOL bMultiInstance)
Which contains the following:
m_bMultiInstance = bMultiInstance;
This functions seems to be called from your application's InitInstance function:
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MFCEXETYPE,
RUNTIME_CLASS(CMFCExeComServerDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CMFCExeComServerView));
AddDocTemplate(pDocTemplate);
m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
Change the underlined bit to TRUE are see how things go. Don't be scared to look at the source code for MFC (or whatever libraries you're using)!
Steve
|
|
|
|