|
Thanks for replying,
I am using visual c++ in windows 2000 Pro edition. The registry entry
tells only that we have 12 or n methods in that interface. How can we query about it.
|
|
|
|
|
Umm, if you don't have a CLSID, then it's a little difficult. You could look through all the registered TYPELIBs and see if the interface is referenced in there, which would give you some clues, but for some interfaces, there are many objects that implement the interface (such as IPersist), and it really doesn't help you.
If you could explain how you come by the interface ID, and why you don't know the CLSID, it's possible (but unlikely) that someone could help (or at least explain why you can't do it)
Steve S
Developer for hire
|
|
|
|
|
Sir,
Sorry for not explaining the context.Because i want to know that is there any way that
we can do it. The actual thing is that i had to use IDiscMaster interface. My os is
Windows 2000. I searched through net and came to know that we have to make use this
IDiscMaster Interface. I searched for it in my machine i found the key in the registry.
but i cannot find a method through which i can get the class object and along with
that i can access the interace ptr of IDiscMaster. PSFactoryBuffer is the object i think i have to get
not sure of that . How do i traverse through that IDiscMaster Interface ?.
Thank you very much
|
|
|
|
|
IDiscMaster is part of the IMAPI (Image Mastering API). This isn't supported on Win2K, only on XP (and later), so you can't create the object that would provide this interface, as it won't be installed on the system. If you check out the MSDN site, it should point you to stuff written by Paul DiLascia which uses this (April '04 issue of MSDN Magazine, IIRC).
Steve S
Developer for hire
|
|
|
|
|
I'm writing a BHO in C++ where I need to modify POST data under certain circumstances.
When I get an Invoke(dispidMember == DISPID_BEFORENAVIGATE2), the POST data is contained in pDispParams->rgvarg[2]. I need to modify that data before I leave Invoke().
Now, I could do:
m_spWebBrowser2->Stop();
m_spWebBrowser2->Navigate(...);
But Navigate() is going to fire another Invoke(DISPID_BEFORENAVIGATE2) event, and without some tricky programming, which I'd like to avoid, I'll wind up in an endless loop.
Is there any way to modify pDispParams->rgvarg[2] so that IE recognizes it upon returning from Invoke()?
|
|
|
|
|
Hi to all !
I've a COM server registered on my machine. How can I use that without importing it's any .tlb file (Because I don't have any). I'm able to get class id using CLSIDFromProgID() but I'm not able to get any Interface ID. Is there any sample or article describing the use of CLSIDFromProgID(), IIDFromString().
Thanks in advance !
-Malli...!
|
|
|
|
|
Have you tried to #import the server module into your project? Sometimes the typelib information might be found inside as a resource.
"no xe tuto oro quel che luse"
rechi+
|
|
|
|
|
Hello Rechi !
I would have done that, but I don't have module code or any .tlb file to import into my project. That's why I went for IIDFromString and CLSIDFromString functions. Those gives me IDs from registry entries. My CLSUDFromString is working fine, but IIDFromString is failing to retrive any interface ID. That's why I couldn't create any object for the component.
-Malli...!
|
|
|
|
|
Malli_S wrote: I don't have module code or any .tlb file
Maybe i didn't understand exactly what you said but by module code do you mean the source code? You might not need it. Just locate the .dll or .exe server file and try to #import it as if it would have been the .tlb file, like this:
#import "c:\server path\server.dll" If you get no error at compile time then the wrapper files were generated in the output path of your project.
The IIDFromString function is just a converter and has no typelib-browsing significance.
"no xe tuto oro quel che luse"
rechi+
-- modified at 2:55 Thursday 13th July, 2006
|
|
|
|
|
hi all,
To develop Com Project in Visual Studio we have a option called ATL
Com Project in the Project Tab. Like the same way Can v develop a Com
project using .net
your
peter
|
|
|
|
|
You can't use the same way in .Net. Instead of ATL project, you can use Class Library or Windows Control Library Project in .Net
Kumar
|
|
|
|
|
hi sir,
i want to write a program to show calculater in c
arun
|
|
|
|
|
Hi !
If you are using VC, try ShellExecute() API.
i.e. ShellExecute(0,"Open","Calc","","",0);
Requires to include "Shellapi.h" file.
-Malli...!
|
|
|
|
|
Hi everyone,
I am currently working on a smartphone project that needs to
communicate with some COM component. Since the .NET compact framework
does not support the DCOM, I decided to create a web service to expose
the COM component's methods and events.
As the some of the COM methods return int** or byte** data back to the
caller, I manually changed the generated interop assembly ( from
IntPtr to IntPtr& for the out going parameter int*** or byte**) after
generating the intermedate language file using ildasm.exe and
regenerate the interop assembly using ilasm.exe utility in order to
get the arrays of bytes or integers for the web service methods.
Here is the problem I am facing:
The web service methods caller can only get the first elements back
from the COM component while windows caller can get all the data back.
I wonder if I need set some binding attribute to make it work for web service.
I would be very grateful if you could help me out.
send me info here or @ guocangz@yahoo.ca
Thank you.
Mike Zhang.
Have a nice day
-- modified at 17:33 Tuesday 11th July, 2006
|
|
|
|
|
.NET Interop really only understands the Automation datatypes. Try using a SAFEARRAY .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I have many resembling activex controls (third party components with their SDKs) ( resemblance in functionnality). they are controls that controls different types of IP Surveillance Camera. I need to develop an application that is independent of them, ie access them independently, so that when i add new control for a new camera, the application needs not be recompiled. so the code has to be external to the application, more than that the linking should be explicit and at execution time rather at load time.
I tried using a DLL which contains a Cwnd object that embeds the activex control in order to declare the EventSink map there and be able to capture events and then relay them to the application by telling the Dll to link to its caller module.
but i did'nt even succeed to make calls in the direct sense, ie application-->exp Dll functions-->Cwnd member functions-->activex specific members, so to create the object etc, the problem being MFC-class pointer can't pass between app and Dll !!?
So how to encapsulate the different activex components in an abstract one. i tried to see COM, but unsuccessfully: is there a sort of activex control inheritance at least (derivation)? Or can I apply containment ( by creation of new activeX control or a general COM component which would contains an object of the particular ActiveX)
here's some other details (Note for the ActiveX control I can access them via C++, by building an MFC proxy class ( Create New class-->MFC class from ActiveX ) then integrate that class into a container where i insert the EventSink Map. Well i succeeded 100% in integrating evry control, and capturing its events, etc, but it's just about encapsulation)
the details :
"
the activex control i'm talking about are as i understood a sort of COM objects, which are to me classes that can be instantiated at execution time, so the dll needs not an implicit link to the client exe.
i have an application that access different camera on the network through those particular activex control, the code being like this :
for example for an axis camera, in the main view window i call
m_Axis.Create(...,this,CRect(..),..); ( m_Axis being here an object of an MFC proxy class to an activeX control (Axis Camera Media Control)).
and of course i handle the onsize member function :
so you can see that the activex control is even responsible for rendering the video stream. other members do the connection, allow me to get a handle to the image being displayed, etc.
so my problem is that i do'nt want the code to be integrated into my application, in order for the application not to depend on those control. so i want some sort of specification such the application can load and talk independently to those objects.
the code would look like :
CcameraControl *_cam[5];
and when the user adds a camera to be controled by the application, a dialog prompting for its ip address, and very possibly its type, appears, then i use the type information to localize the control which is then loaded into a case of the table above.
so i need to encapsulate, create new controls for evry activex, such that those control have the same functions and can talk to the caller-application using a same mechanism.
here's what i tried :
i thought i must derive new classes from the activex control, such those classes have the same functions. they need to relay the control from the application to their parent specific services. and capture events back from their parent and relay them to the application, but here i came to the inevitable ad the impossible :
although succeeding in encapsulating the controls into uniform components, there is no WAY for those classes to be loaded at the execution time and behave as true plug-in components. for example for MFC, if there is a wa&y to write a dll that exports some classes dervived from mfc classes, that dll need be implicitly linked to the exe, and this latter wouldn't succeed even to load without her.
Is in COM, ATL a solution ?
So what i did was to create a simple dll, that can access mfc, then in the CWinApp object i declared a Cwnd object ( acontainer for the specific control) and to there i shifted an activex control data member: when the window is created, it creates the control in its area. i declared the eventsink map in the CWnd so to capture the events. and then you have simple plain exportable functions that enable the caller to create the internal CWnd object and calles its members. but since i need to pass a parent window (originating from the application interface classes) then the problem i talked about comes ( mfc pointer)
here's also what i tried :
a new MFC ActiveX project, thinking i can apply the containment principle :
an abstract, wrapper Control contains the specific one, relay the evnts in either senses, but it just didn't work, the specific activex control create function fails when the OnCreate container member function is called to load the global control"
Thank u in advance.
charfeddine_ahmed@yahoo.fr
|
|
|
|
|
hi:
i want to change the recipents of outlook2003 after the user clicked the send-button. For example, the old email-address is "aaa<aaa@aaa.com>" , and i want to change it to "aaa<bbb@bbb.com>". the display-name is kept, but the email-address is changed.
i use function IExchExtMessageEvents::OnCheckNames(IExchExtCallback *lpExchangeCallback), as following code:
STDMETHODIMP mymail::OnCheckNames(IExchExtCallback *lpExchangeCallback)
{
HRESULT hRet = S_OK;
LPMESSAGE lpMessage = NULL;
LPMDB lpMdb = NULL;
LPADRLIST pRecipentRows = NULL;
ULONG ulValues, ulTag;
lpExchangeCallback->GetRecipients(&pRecipentRows);
if( pRecipentRows->cEntries == 0 )
return S_FALSE;
for(unsigned long n = 0; n < pRecipentRows->cEntries; n++ ){
ulValues = pRecipentRows->aEntries[n].cValues;
for(unsigned long i = 0; i < ulValues; i++){
ulTag = pRecipentRows->aEntries[n].rgPropVals[i].ulPropTag;
if( PR_EMAIL_ADDRESS == ulTag || PR_DISPLAY_NAME == ulTag){
//new address
char* p = "bbb@bbb.com";
char* pNewContact = NULL;
MAPIAllocateBuffer(strlen(p)+1, (LPVOID FAR *)&pNewContact);
strcpy(pNewContact, p);
//change email address
pRecipentRows->aEntries[n].rgPropVals[i].Value.lpszA = pNewContact;
}
}
}
hRet = lpExchangeCallback->SetRecipients(pRecipentRows);//hRet is S_OK;
return hRet ;
}
when i debugging, the "bbb@bbb.com" is set to the pRecipentRows, but the outlook2003 still send email as old emil-address "aaa@aaa.com". why?
who could help me?
thanks alot
my email: how_fly@yahoo.com
|
|
|
|
|
hi,
I want to know how do we use BSTR and VARIANT .Can any one please tell where to find the information about these?
Thank You
|
|
|
|
|
MSDN (Microsoft's Developer web pages) will tell you everything you need to know. Also, you might want to try Google, using "BSTR" and/or "VARIANT" as your search parameters.
msdn.microsoft.com
www.google.com
Hope that helps!
|
|
|
|
|
I want to know, What Design Pattern does ATL/COM is based upon, I dont want what ATL/COM support, What I need is ON WHAT DESIGN ATL/COM is build upon???
regards
Balkrishna Talele
|
|
|
|
|
I am not too sure, but it is based on "bridge" pattern.
thanks,
Mac
-- modified at 6:03 Tuesday 11th July, 2006
|
|
|
|
|
hi to all and best of luck. )I'm stuck-up here with the problem .. I could manage to pass string to another process/application using WM_COPYDATA but it takes v. long to pass a structure.
i wish if you can give me any code that allows passing "structure" between 2 applications
------------this is class one - sending message
Imports System.Runtime.InteropServices
Public Class clsIPC
Inherits System.Windows.Forms.NativeWindow Implements IDisposable
Private Const GLOBAL_IDENTITY_ONE = "GLOBAL_IDENTITY_ONE"
Private Const GLOBAL_IDENTITY_TWO = "GLOBAL_IDENTITY_TWO"
Private Const MESSAGE_FOR_ONE = "MESSAGE_ONE"
Private Const MESSAGE_FOR_TWO = "MESSAGE_TWO"
Private Const WM_COPYDATA As Integer = &H4A
#Region "API Declaration"
<structlayout(layoutkind.sequential)> _
Private Structure CopyData
Public dwData As IntPtr
Public cbData As Integer
Public lpData As IntPtr
End Structure
Private Declare Auto Function SendMessage Lib "user32" _
(ByVal hWnd As IntPtr, _
ByVal Msg As Integer, _
ByVal wParam As IntPtr, _
ByRef lParam As CopyData) As Boolean
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" _
(ByVal lpString As String) As IntPtr
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As IntPtr, ByVal wMsg As IntPtr, ByVal wParam As Integer, _
ByVal lParam As Integer) As IntPtr
#End Region
#Region "process for messanging to application GLOBAL_IDENTITY_TWO"
'get handle of globlal application named GLOBAL_IDENTITY_TWO
Public ReadOnly Property GET_HANDLE_TWO() As IntPtr
Get
Return FindWindow(vbNullString, GLOBAL_IDENTITY_TWO)
End Get
End Property
Structure PT
Dim x As Object
Dim y As Char
Dim xy As String
End Structure
Dim MyVariable As New PT
Public Function sendMessageToTwo()
Dim data As CopyData
Dim message As String = "this is to be sent"
Dim hwndTarget As IntPtr
Dim MessageId As IntPtr
hwndTarget = Me.GET_HANDLE_TWO
MessageId = ONE_TO_TWO_MESSAGEID()
MyVariable.x = message
MyVariable.y = "c"
MyVariable.xy = "String is here"
System.GC.KeepAlive(MyVariable)
data.lpData = Marshal.AllocHGlobal(Marshal.SizeOf(MyVariable))
data.cbData = Marshal.SizeOf(MyVariable)
Dim MyPointer As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(MyVariable))
Marshal.StructureToPtr(MyVariable, data.lpData, True)
SendMessage(hwndTarget, WM_COPYDATA, Me.Handle, data)
MsgBox("WM_COPYDATA")
Exit Function
If Not System.IntPtr.Zero.Equals(hwndTarget) Then
Call PostMessage(hwndTarget, MessageId, 0, 0)
MsgBox("Message sent")
Else
MsgBox("Unable to send Message ! probably GLOBAL_IDENTITY_TWO Not found")
End If
End Function
Public ReadOnly Property ONE_TO_TWO_MESSAGEID() As IntPtr
Get
Static objONE_TO_TWO_MESSAGEID As IntPtr
If IntPtr.Zero.Equals(ONE_TO_TWO_MESSAGEID) Then
objONE_TO_TWO_MESSAGEID = RegisterWindowMessage(MESSAGE_FOR_TWO)
End If
Return objONE_TO_TWO_MESSAGEID
End Get
End Property
#End Region
Region "dispose method and new()/constructor"
Public Sub Dispose() Implements IDisposable.Dispose
If Not Me.Handle.Equals(IntPtr.Zero) Then
Me.ReleaseHandle()
End If
End Sub
Public Sub New()
Dim Params As CreateParams = New CreateParams
Params.Caption = GLOBAL_IDENTITY_ONE
Me.CreateHandle(Params)
End Sub
#End Region
End Class
--------------------------------------xxxxxxxxxxxxxxxxxxxxxxxxxx----------------------------------
----this is class two-listening to message-----------
Imports System.Runtime.InteropServices
Public Class clsIPC
Inherits System.Windows.Forms.NativeWindow Implements IDisposable
Private Const GLOBAL_IDENTITY_ONE = "GLOBAL_IDENTITY_ONE"
Private Const GLOBAL_IDENTITY_TWO = "GLOBAL_IDENTITY_TWO"
Private Const MESSAGE_FOR_ONE = "MESSAGE_ONE"
Private Const MESSAGE_FOR_TWO = "MESSAGE_TWO"
Private Const WM_COPYDATA As Integer = &H4A
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" _
(ByVal lpString As String) As IntPtr
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As IntPtr, ByVal wParam As Integer,ByVal lParam As Integer) As IntPtr
<structlayout(layoutkind.sequential)> _
Private Structure CopyData
Public dwData As IntPtr
Public cbData As Integer
Public lpData As IntPtr
End Structure
Structure PT
Dim x As Object '<<<----- whenever i use object as member of a structure i get an exception An unhandled exception
'of type 'System.ExecutionEngineException' occurred in mscorlib.dll if i use string as a
'member there is no error
Dim y As Integer
Dim xy As Integer
End Structure
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_COPYDATA
Dim data As CopyData
Dim message As String
Dim MyPoint As New PT
data = CType(m.GetLParam(GetType(CopyData)), CopyData)
MyPoint = Marshal.PtrToStructure(data.lpData, GetType(PT)) <<<---- @ this point i'm getting the error [debug]
'MyPoint = Marshal.PtrToStructure(CType(m.GetLParam(GetType(CopyData)), CopyData).lpData, GetType(PT))
MsgBox(CType(MyPoint.x, String))
Case TWO_TO_ONE_MESSAGEID().ToInt32
MessageBox.Show("GOT A MESSAGE FROM ONE--- CALLING METHOD A", "VBNETMessaging")
Call A()
End Select
MyBase.WndProc(m)
End Sub
Private Sub A()
MsgBox("Message from Method A")
End Sub
Public ReadOnly Property TWO_TO_ONE_MESSAGEID() As IntPtr
Get
Static objTWO_TO_ONE_MESSAGEID As IntPtr
If IntPtr.Zero.Equals(objTWO_TO_ONE_MESSAGEID) Then
objTWO_TO_ONE_MESSAGEID = RegisterWindowMessage(MESSAGE_FOR_TWO)
End If
Return objTWO_TO_ONE_MESSAGEID
End Get
End Property
#Region "dispose method and new()/constructor"
Public Sub Dispose() Implements IDisposable.Dispose
If Not Me.Handle.Equals(IntPtr.Zero) Then
Me.ReleaseHandle()
End If
End Sub
Public Sub New()
Dim Params As CreateParams = New CreateParams
Params.Caption = GLOBAL_IDENTITY_TWO
Me.CreateHandle(Params)
End Sub
#End Region
End Class
--------------------------------------xxxxxxxxxxxxxxxxxxxxxxxxxx----------------------------------
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Use .Net Remoting 2.0.
You can choose IPC instead of the usual TCP.
Take a look: .NET Remoting 2.0 - IPC
Eran Aharonovich (eran.aharonovich@gmail.com )
Noviway
|
|
|
|
|
I have MFC application that works as EXE COM SERVER . I wish to convert it to EXE SERVICE in purpose to connect the client application via the net .
I am all ready have a connection point in to the EXE COM SERVER to connect the client . but my main problem is to activate DCOM SERVER in side of the net.
Thank you .
|
|
|
|
|
My normal technique for invoking MySql is producing LNK2001 errors from a com project, using paths that work for an exe based application. Anyone succeed in making this a MySQL connection from a COM dll?
Thanks
Ger
|
|
|
|
|