Click here to Skip to main content
15,891,905 members
Home / Discussions / COM
   

COM

 
GeneralUnable to synchronize the data from SQL Server CE Pin
24-Sep-01 0:07
suss24-Sep-01 0:07 
Generalretrun BSTR Pin
Eran22-Sep-01 3:25
Eran22-Sep-01 3:25 
GeneralRe: retrun BSTR Pin
Aaron Schaefer24-Sep-01 5:49
Aaron Schaefer24-Sep-01 5:49 
GeneralRe: retrun BSTR Pin
Michael Dunn24-Sep-01 14:55
sitebuilderMichael Dunn24-Sep-01 14:55 
GeneralCOMAddin for Word2000 and Excel2000 Pin
Sree Ram21-Sep-01 8:55
Sree Ram21-Sep-01 8:55 
GeneralMFC CFtpFileFind CFtpConnection and timeout Pin
Amit Dey21-Sep-01 6:07
Amit Dey21-Sep-01 6:07 
GeneralRe: MFC CFtpFileFind CFtpConnection and timeout Pin
Carlos Antollini21-Sep-01 6:44
Carlos Antollini21-Sep-01 6:44 
GeneralAdvanced problem -- DCOM remoting in VB without configuration of DCOMCNFG Pin
21-Sep-01 4:50
suss21-Sep-01 4:50 
I am trying to instantiate a COM Server on a remote machine without
configuring either the client or the server machine via DCOMDNCFG.EXE.
Basically, the COM Server will NOT be registered on the client machine, but
only registered on the server machine. The calling client is a VB COM
object trying to remote another COM object. I have it working with some
objects that I wrote... but I cannot get it to work with the SQLDMO objects
(Server/Restore).

I found some information on the web for doing something similar, but it only
worked if you had a dummy COM server with the same interface registered on
the client machine so that when calling CLSIDFromProgID(), the call would
succeed in retrieving the CLSID for the later call to CoCreateInstanceEx().
I changed it to pass in the CLSID so I didn't need the call to
CLSIDFromProgID(), and I convert it to a UUID structure for passing to
CoCreateInstanceEx(). It works with some other VB objects I wrote... and
at first, I thought it was because they are registered on the client
machine. However, so are the SQLDMO objects, and they fail to work using
this method.

See the code below. Anyone have any ideas for me?

Thanks,

Rob

--

Public Function CreateObjectRemoteByCLSID(ByVal strCLSID As String, ByVal
strServerName As String) As Object

' NOTE: Can be used even if the CLSID specified is NOT installed on
client machine.

Const PROC_NAME = MODULE_NAME & ".CreateObjectRemoteByCLSID"

Const RPC_S_OK As Long = 0

Dim server() As Byte
Dim QI As MULTI_QI
Dim SS As SERVER_STRUCTURE
Dim refiid(16) As Byte
Dim lngReturn As Long

Dim CLSID As UUID

' ensure that leading and trailing {} are dropped
If Right$(strCLSID, 1) = "}" Then strCLSID = Left$(strCLSID,
Len(strCLSID) - 1)
If Left$(strCLSID, 1) = "{" Then strCLSID = Mid$(strCLSID, 2)

' build UUID structure from CLSID
lngReturn = UuidFromString(strCLSID, CLSID)
If lngReturn <> RPC_S_OK Then
Err.Raise -1, PROC_NAME, "Invalid CLSID: " & strCLSID
End If

' setup variables for CoCreateInstanceEx; initialize OLE
GetIIDforIDispatch refiid() 'set an IID for IDispatch
QI.pIID = VarPtr(refiid(0)) 'point to the IID
server = strServerName & Chr$(0) 'specify the server
OleInitialize 0 'initialise OLE

' point to server name and
' invoke a remote instance of the desired object
SS.pServer = VarPtr(server(0))
lngReturn = CoCreateInstanceEx(CLSID, 0, 16, SS, 1, QI)

If lngReturn <> 0 Then
Err.Raise lngReturn, PROC_NAME, "CoCreateInstanceEx returned error
code " & Hex$(lngReturn)
End If

' pass back object reference
Set CreateObjectRemoteByCLSID = QI.pInterface

End Function
GeneralTo pass a structure/class object across com components Pin
20-Sep-01 23:48
suss20-Sep-01 23:48 
GeneralRe: To pass a structure/class object across com components Pin
Not Active21-Sep-01 2:33
mentorNot Active21-Sep-01 2:33 
GeneralRe: To pass a structure/class object across com components Pin
Aaron Schaefer21-Sep-01 4:01
Aaron Schaefer21-Sep-01 4:01 
GeneralRe: To pass a structure/class object across com components Pin
ioannhs_s21-Sep-01 5:08
ioannhs_s21-Sep-01 5:08 
GeneralCOMponent dependencies Pin
Brian van der Beek20-Sep-01 22:50
Brian van der Beek20-Sep-01 22:50 
GeneralDISPPARAMS (COM) Pin
20-Sep-01 0:27
suss20-Sep-01 0:27 
Generaladsi:create attribute failed! Pin
19-Sep-01 22:34
suss19-Sep-01 22:34 
Generalpassing char * to COM Object function Pin
Stephane Denis19-Sep-01 17:31
Stephane Denis19-Sep-01 17:31 
GeneralRe: passing char * to COM Object function Pin
Chris Losinger19-Sep-01 17:51
professionalChris Losinger19-Sep-01 17:51 
GeneralRe: passing char * to COM Object function Pin
Stephane Denis20-Sep-01 10:37
Stephane Denis20-Sep-01 10:37 
GeneralRe: passing char * to COM Object function Pin
Chris Losinger20-Sep-01 10:50
professionalChris Losinger20-Sep-01 10:50 
GeneralRe: passing char * to COM Object function Pin
Michael P Butler20-Sep-01 10:51
Michael P Butler20-Sep-01 10:51 
GeneralRe: passing char * to COM Object function Pin
Stephane Denis20-Sep-01 11:45
Stephane Denis20-Sep-01 11:45 
GeneralUser defined structure cannot be exported as a property Pin
19-Sep-01 7:52
suss19-Sep-01 7:52 
GeneralRe: User defined structure cannot be exported as a property Pin
ioannhs_s21-Sep-01 5:08
ioannhs_s21-Sep-01 5:08 
GeneralCOM Addins (A request for guidence and ideas) Pin
Michael P Butler18-Sep-01 23:34
Michael P Butler18-Sep-01 23:34 
GeneralRe: COM Addins (A request for guidence and ideas) Pin
Michael P Butler19-Sep-01 0:51
Michael P Butler19-Sep-01 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.