|
Hi Stuart !!
Thanks for ur reply ..
Can u give me about how to use above syntax with
#import "c:\Windows\System32\cdosys.dll" raw_interfaces_only
#import "c:\WINNT\system32\cdosys.dll" raw_interfaces_only
Thanks
abc
|
|
|
|
|
Same thing - open cdosys.dll in the OLE-COM Viewer (you'll find it either in your Visual Studio directory or in your Microsoft SDKs directory, both of which are in c:\Program Files) and look for the library's GUID.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I am getting crash while copying a VARIANT type to _variant_t type. Can anybody help me with the possible reason?
|
|
|
|
|
How are you doing the copying?
If you're creating a new object you just use the constructor to do it.
VARIANT v;
_variant_t vt(v);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
I used SHGetDesktopFolder to get IShellFolder of desktop. How can i use this interface to get IShellView of an different folder(eg:- C:\Test).I need this interface to select multiple items from the 'Test' folder.
Please advice.
Regards,
J
|
|
|
|
|
|
we are using any VB 6.0 com component through interop in asp.net web application. surprisingly it works fine
with the visual studio web server but does not work with IIS webserver. we also impersonate the machine user with highest privilages and other access permission but it still does not work and throw the COM interop exception.
Any help in this would be highly appreciated.
|
|
|
|
|
Hello,
I have been trying to find some resources for hosting a .NET winform control in a MFC \ COM app written in C++ 2003 (7.1). I could find help for .NET 2.0 and C++ 2005 but none for C++ 2003. Could anybody help?
Thanks in advance.
|
|
|
|
|
How to do the CoCreateInstance,when You have only the DLL path and name
say for example I have a Dll named xyz.dll
I just #import it and register it now how I will get its Class ID to do the CoCreateInstance.
Pleae HELP
|
|
|
|
|
There will be a structure in the code generated by the #import statement that represents the class. You can do __uuidof(that struct) to get its CLSID. Look at the example I have here using Excel:
#import "libid:00020813-0000-0000-C000-000000000046" version("1.6") auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")
int _tmain(int argc, _TCHAR* argv[])
{
CoInitializeEx(0, COINIT_MULTITHREADED);
{
Excel::_ApplicationPtr xl;
if (SUCCEEDED(xl.CreateInstance(__uuidof(Excel::Application))))
{
}
}
}
HTH!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank You very much
But can you please tell me that how to get the IID our we get it in the similar manner.
m_pIDocument.CreateInstance(__uuidof(Excell::IApplication));
|
|
|
|
|
IID? For the interface? That's determined by the interface pointer class you're using to create the instance. In my example, the IID will be the IID of Excel::_ApplicationPtr , which can be accessed using __uuidof(Excel::_ApplicationPtr) , IIRC.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have done my code this way
hr = CoCreateInstance(__uuidof(CADFilter::NW_Document),
NULL,
CLSCTX_INPROC_SERVER ,
__uuidof(CADFilter::NW_IDocument) ,
(void**)&m_pIDocument );
But the issuse is I am getting a message box getting pooped up while running the application.
And when I comment my change there is no such issue
|
|
|
|
|
deadlyabbas wrote: the issuse is I am getting a message box getting pooped up while running the application.
And when I comment my change there is no such issue
For a start, what does the message box say?
Also - if m_pIDocument is a smart COM pointer which is of interface type NW_IDocument underneath, then this code is more idiomatically correct:
m_pIDocument.CreateInstance(__uuidof(CADFilter::NW_Document), CLSCTX_INPROC_SERVER);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
Following is the code I am trying to do
#import "C:\\Program Files\\BOSS\\SUPPORT\\RealDWG\\cf2407.dll" rename_namespace("CADFilter")
AcRx::AppRetCode acrxEntryPoint (AcRx::AppMsgCode Msg,
void* AppId)
{
// local variables
int cindex;
CADFilter::NW_IDocument *m_pIDocument;
CLSID clsid;
CoInitialize (NULL);
HRESULT hr = CLSIDFromProgID(LPCOLESTR("NW_Document"), &;clsid );
hr = CoCreateInstance( clsid, NULL,CLSCTX_ALL , __uuidof(CADFilter::NW_IDocument) , (void**)&m_pIDocument );
if(SUCCEEDED(hr))
{
AfxMessageBox(_T("Hi"));
}
}But I am getting an " HRESULT hr as an "Invalid class string"
|
|
|
|
|
Probably means "NW_Document" isn't a valid ProgID.
Easiest way to find a class's CLSID given the DLL that contains it is probably to use the OLE-COM Object Viewer. Use the 'View Typelib' command to open the DLL. That'll display an IDL representation of the DLLs type library, including IIDs and CLSIDs.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Dear All,
I have a debug version of vc++ project.
The project result will be called by other program using COM interface.
I use "/embedding" at "Command Arguments" ( MSVC++ 2005).
It works just fine with XP..I can debug the project.
But not with Vista...the loader program will load another instance instead connecting to the one that aleady loaded in memory..
Did I miss some settings ?
Thanks..
|
|
|
|
|
I am writing an out-of-proc COM server. I would like a single instance of my server to handle all clients. This works OK on Vista for clients running at the same privilege level. But if one client is running at normal privileges and another is running as admin, two separate instances of my server will be launched.
Is there any way to allow a single instance of my server handle all clients?
Wayne
|
|
|
|
|
Hi All
I am getting error error when i am useing InvokeHelper.Function
Declreation in Test Header file
VARIANT Get_List(int* SheetName);
And Define in Cpp file of Test
VARIANT Test::Get_List(int* SheetName)
{
VARIANT result;
static BYTE parms[] =
VTS_PI1;
InvokeHelper(0x60030002, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms,
SheetName);
return result;
}
use Get_List function in main Class FinalDlg like this
Test objXl;
int sCol=3;
objXl.Get_List(&sCol);
Then i am getting
"Type misMatch" in class wincore.cpp.
Plz help me
|
|
|
|
|
"result" variable is uninitialized.
With best wishes,
Vita
|
|
|
|
|
Thanks for reply.
But result variable is initialize here
VARIANT result;
Sorry can you describe more.
|
|
|
|
|
No, this is uninitialized variable. But it doesn't help as I see the code of MFC.
So, I think that VTS_PI1 is unapplicable here. Use VTS_PUI1 or VTS_PI4.
With best wishes,
Vita
|
|
|
|
|
Ok i use
VTS_PUI1 or VTS_PI4. both now error is same.
If you need example code then i will give you.I need help.
|
|
|
|
|
What declaration of method 0x60030002 do you have? What is a "Test objXl"?
With best wishes,
Vita
|
|
|
|
|
See i don't much about InvokeHelper.I had download a project from Codeproject and make new project with the help of downloaded project.I am sending you a project link which have example code and Dll.
Link is here
Automating Microsoft Excel and Word Together[^]
I am creating a new dll and write a new function.
Public Function Get_List(SheetNumber As Long) As String
' Dim myExcel As Object
Dim Counter1 As Integer
Dim Returnstring As String
Dim myWorkBook As Excel.Workbook
Dim tworksheet As Excel.Worksheet
' myExcel = CreateObject("Excel.Application")
' myWorkBook = myExcel.Workbook.Open("C:\sample.xls")
For Each tworksheet In myWorkBook.Worksheets
' Me.ListBox1.Items.Add (tworksheet.Name)
Returnstring = tworksheet.Name
If iindex = Counter1 Then
Get_List = Returnstring
End If
Counter1 = Counter1 + 1
Next
End Function
And try to access in vc++.Then i am getting error
Plz help me
|
|
|
|