GPIB in QT
-
I have one more question, I tried the direction you gave me from below link:
http://support.microsoft.com/kb/828736
In the article, the step 9 of "Call the Managed DLL from Native C++ Code",
@// Initialize COM.
HRESULT hr = CoInitialize(NULL);// Create the interface pointer.
ICalculatorPtr pICalc(__uuidof(ManagedClass));long lResult = 0;
// Call the Add method.
pICalc->Add(5, 10, &lResult);wprintf(L"The result is %d", lResult);
// Uninitialize COM.
CoUninitialize();
return 0;@
What is "ICalculatorPtr"?? The .dll I built from above link, ICalculator is interface, my question is if I want to use .dll from device manufacturer provided, their .dll file should be written from interface ?? -
Does anybody know!?
-
-
Thanks, my code can work well.But I want to know what is “ICalculatorPtr”, I didn't see any definition of it. Because if I use this method in the future, this would be a important issue. Thanks in advance.
-
I've never seen it myself, sorry. Try asking at a Microsoft forum, since it's from Microsoft API.
-
Thank you:)). If I can't get answer here, maybe I'll go to ask in Microsoft forum.Does any body know what is “ICalculatorPtr” and how does it generate??
-
[quote author="Ivan1120" date="1374589946"]Thanks, my code can work well.But I want to know what is “ICalculatorPtr”, I didn't see any definition of it. Because if I use this method in the future, this would be a important issue. Thanks in advance.[/quote]
It's a typedef of smart pointer _com_ptr_t
http://msdn.microsoft.com/en-us/library/8etzzkb6(v=vs.71).aspx
-
Thanks:)), Something I'm confused still, according to released document from Microsoft , if I want to use .dll file with managed code in native c++ environment, like "QT", does class in the .dll should be designed to inherit "Interface"?? like following link.
-
Hi, everyone. Does anybody know above question!?
-
[quote author="Ivan1120" date="1374801537"]Hi, everyone. Does anybody know above question!?[/quote]This is a Qt forum, so not everyone here has experience with the .NET framework (some people here don't even use Windows). Try asking at a Microsoft forum.
-
I see, thank you.
-
I developed a set of library/ driver to communicate with Spectrum analyzer, dc supplier, PNA thru GPIB or USB using only Qt.
works very well, use it from a main program using .dll
M.