I am trying to build an application using C# to communicate and control my SM2315D (ver: 440C) motors.
I have successfully referenced the IntegMotorInterface.dll, but when I try to instantiate the SMIHost object, I get:
"Additional information: Retrieving the COM class factory for component with CLSID {BC26FBBA-00E1-11D4-B5D0-00600831E1F3} failed due to the following error: 80040154."
I think its telling me that something isn't registered, but I can run the SmartMotor Interface without any problems
What am I doing wrong?
Thanks in advance
You have a windows system registry error, It has nothing to do with the dll itself. Try this link:
http://forums.asp.net/p/1119052/4092943.aspx
It covers your error.
Windows operating system and 32 vice 64 bit makes a difference as well.
Thanks for the info.
Just after I posted this message, I found the solution to the problem. I was creating a 64-bit application using a 32-bit dll. And they didn't work together.
As soon as I changed the application to a 32-bit app, the driver loaded properly, and I'm able to communicate with the motors.
Thanks again.
Hilarion,
How did you link to the .dll? I see there's a "IntegMotorInterface.dll" in C:WindowsSysWOW64, but I don't see IntegMotorInterface.lib.
Thanks!
Have you installed the SMI software? It has examples and installs the dll.
The software is available at...
http://www.animatics.com/index.php?option=com_content&view=article&id=104&Itemid=9&dir=JSROOT%2Ftop+level/Software
The latest version of the programming software is SMI_2_4_3_7.msi
Yeah, I did install the SMI software. I'm making slow progress. It would be nice if the examples were simple and well-commented, as opposed to a GUI MFC application with hardly any comments. Baby steps first, you know?
So the VCClient2100 example runs perfectly. Most recently I'm having trouble creating an SMIHost instance. This code compiles but I get the "Cannot create an instance of "SMIHost" class!" error upon running... Am I missing an include or ??? This is a Windows console application with Visual Studio 2010 full version.
#include
using namespace std;
#import "C:Program Files (x86)AnimaticsSMIEngineSamplesIntegMotorInterface.tlb"
using namespace INTEGMOTORINTERFACELib; // Must come after IntegMotorInterface.tlb
// Define a smart pointer to the interface ISMIComm
ISMICommPtr CommInterface;
ISMICMotionPtr CMotionInterface;
ISMIPathPtr PathInterface;
int main()
{
// Create SMIHost object and interfaces
HRESULT hr = CommInterface.CreateInstance(__uuidof(SMIHost));
if(FAILED(hr))
{
cout<<"Cannot create an instance of "SMIHost" class!"<<endl;
//return FALSE;
}
cout<<"Done."<<endl;
return TRUE;
}
It sounds as though the .dll is not registered, but if VCClient2100 runs, that would indicate that it is.
About all I can offer here, is to ask that you zip up your project, and send it in an email to support@animatics.com ...along with your contact info. Include that it should be sent to Chuck... and I'll get the project to the right people to see what is going wrong.
Alright. Thanks.
http://forums.codeguru.com/showthread.php?483418-CoInitialize-has-not-been-called
int main()
{
CoInitialize( NULL );
// Create SMIHost object and interfaces
HRESULT hr = CommInterface.CreateInstance(__uuidof(SMIHost));
if(FAILED(hr))
{
cout<<"Cannot create an instance of "SMIHost" class!"<BaudRate = 9600;
cout<<"Done."<<endl;
return TRUE;
}