|
For Creation of the COM object try the following code
::CoInitialize(NULL);
IToolBar *pTest;
HRESULT hr=::CoCreateInstance(CLSID_Test,NULL,CLSCTX_INPROC_SERVER,IID_ITest,(void**)&pTest);
if(FAILED(hr))
return 0;
pTest->MsgBox();
pTest->Release();
pTest=NULL;
::CoUninitialize();
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
WE ARE ATTACTING PIC TO A BLACK BOX TO TAKE CERTAIN READINGS.WE ARE ALREADY UTILYSING OUR PC TO SEND PRIORITY COMDS TO ANOTHER PIC. WE WANT TO ATTATCH A PEN DRIVE ON PICS COM PORT AND STORE READINGS TAKEN FROM BLACK BOX. CAN SOMEONE PL PROVIDE US WITH SUITABLE PROGRAM
SHERGILL
|
|
|
|
|
Never SHOUT in forums. It's considered rude and also hard to read.
Look here[^] for posting guidelines.
Also this forum is about COM, as in Component Object Model, not COMmunications ports.
If you need a terminal program I suggest TeraTerm[^] which usually covers the needs.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Shh!
Aside from being loud, this is confusing; you can't generally plug a pen drive into a com port, it goes into a USB host.
Or did you mean that your PIC is sending data to a PC com port and you want to store that to a file on a pen drive plugged into the PC?
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: you can't generally plug a pen drive into a com port, it goes into a USB host
Naah, you're assuming a lot here.
I know I used a barcode reader that had the shape of a pen that connected to the serial port about 12 years ago, he might have meant a "pen" like that.
Also the PIC16F877 doesn't have any USB ports, but it is equipped with a UART.
You'll find some more info about the MCU here[^].
This guy is completely off topic for this forum since he apparently misunderstood what COM means, but I suspect he needs some kind of terminal program.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Thanks Roger. As it happens, I have a couple of serial programmers for PIC devices, so the link to microchip was kind of redundant for me.
OTOH, a lot of other people might not have, so you've just educated a few
Most barcode wands from when I was a lad* were serial ones, except for the ones which were keyboard wedges. I don't think this USB malarkey will ever really catch on.
Steve S
Developer for hire
*No, I'm not admitting how many decades ago that is
|
|
|
|
|
Steve S wrote: No, I'm not admitting how many decades ago that is
Time flies, doesn't it?
BTW, sorry for telling you things you already knew. Apparently you're not the only one assuming things here... :->
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
It certainly does; of course, my eldest son is old enough to drink in California, and my daughter is old enough to vote in UK elections, so I shouldn't be surprised by anything any more!
No, it was a reasonable assumption.
I wonder if CP ought to run a poll on "Do you know anything about microcontrollers, and do you own a programming device for any of them?"
I never cease to be amazed by what people (including me, of course) don't know. I am given to understand that there are still people who believe that here in the UK we have a democracy and a free press...
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: It certainly does; of course, my eldest son is old enough to drink in California, and my daughter is old enough to vote in UK elections
Mmm, I know the feeling.
My step-daughter has recently made her choice for secondary upper school. Phweee!
A small comfort is the fact that she's my step-daughter. But anyway...
Steve S wrote: No, it was a reasonable assumption
Actually I was involved in developing the software for a large system with PIC17C756 MCUs.
That was a real challenge since this MCU only have 902 bytes of RAM and there were approximately 80 of them. Long days and nights.
But it was fun.
Steve S wrote: there are still people who believe that here in the UK we have a democracy and a free press...
Yeah, and here in Sweden we officially have virtually none that are unemployed and the small amount of people that cannot be hidden in the system are decreasing...
All the best
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
hey big guy
i know that pen drive goes into a usb port.ever heard off connectors that can be attatched to pic to to connect a pen drive. if you r still not getting it i will send a snap just to make u wise
|
|
|
|
|
hello friends following code is used to show outlook express send mail dialog box. But i am unable to attach a file.
can someone tell me how to do this?
code::::::::::::::::
_NameSpacePtr pNameSpace;
MAPIFolderPtr pOutbox;
_ItemsPtr pOutboxItems;
_MailItemPtr pNewMail;
CComPtr<attachments> pAtach;
RecipientsPtr pRecipients;
RecipientPtr pRecipient;
HRESULT hr = NULL;
_ApplicationPtr m_pApp("Outlook.Application");
CComPtr <_Inspectors> pInspectors;
m_pApp->get_Inspectors(&pInspectors);
m_pApp->get_Session(&pNameSpace);
pNameSpace->GetDefaultFolder(olFolderInbox,&pOutbox);
pOutbox->get_Items(&pOutboxItems);
VARIANT Type;
m_pApp->CreateItem(olMailItem,(IDispatch**)&pNewMail);
CComPtr <_Inspector> pInspector;
hr = pInspectors->Add(pNewMail, &pInspector);
if(FAILED(hr))
return ;
hr = pInspector->Activate();
if(FAILED(hr))
return ;
hr = pInspector->Display();
if(FAILED(hr))
return ;
|
|
|
|
|
I have imported a .dll like as follow:
#import "E:\AtlOcx\Debug\AtlOcx.dll"
In the CLient Application,I wrote like this
BEGIN_INTERFACE_MAP(CATLDiceObjSink, CCmdTarget)
INTERFACE_PART(CATLDiceObjSink, DIID__IATLDiceObjEvents, Dispatch)
END_INTERFACE_MAP()
But when a compiled the client program,It has a error like as follow:
--------------------Configuration: AtlClientTest - Win32 Debug-----------
Compiling...
ATLDiceObjSink.cpp
D:\me\VC学习\ATL\AtlClientTest\ATLDiceObjSink.cpp(61) : error C2065: 'DIID__IATLDiceObjEvents' : undeclared identifier
Error executing cl.exe.
Creating browse info file...
AtlClientTest.exe - 1 error(s), 0 warning(s)
---------------------------------------------------------------------------
Can someone tell me how to include 'DIID__IATLDiceObjEvents' ?
Thanks in advance.
|
|
|
|
|
I think you could use the named_guids attribute when importing the dll.
#import "E:\AtlOcx\Debug\AtlOcx.dll" named_guids
Also include the file: "E:\AtlOcx\Debug\AtlOcx.tlh" (or whatever that is generated) in your code.
this is this.
|
|
|
|
|
use __uuidof(IATLDiceObjEvents) instead of DIID__IATLDiceObjEvents
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
It's ok now!And I want to konw why it works well using DIID__IATLDiceObjEvents in sometimes,but not in my project.
Thank you very much for help!
|
|
|
|
|
Fine,it works only when we imports the GUIDS from the DLL as Follows
#import "mypath\mydll.dll" named_guids
named_guids attribute
The named_guids attribute tells the compiler to define and initialize GUID variables in old style, of the form LIBID_MyLib, CLSID_MyCoClass, IID_MyInterface, and DIID_MyDispInterface
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
-- modified at 0:06 Thursday 18th May, 2006
|
|
|
|
|
I wnat to know how to register a dll com component in C# using windows APi not a shell command.
Please I need it urgently.
|
|
|
|
|
1. Load the dll with ::LoadLibrary()
2. Get the address of the library's exported function DllRegisterServer with ::GetProcAddress()
3. Call the library's DllRegisterServer()
4. Unload the library with ::FreeLibrary()
Like this, pasted from MSDN:
typedef HRESULT (STDAPICALLTYPE *CTLREGPROC)() ;
HMODULE hModule = ::LoadLibrary(m_strPathName) ;
CTLREGPROC DLLRegisterServer =
(CTLREGPROC)::GetProcAddress(hModule,"DllRegisterServer" ) ;
DLLRegisterServer() ;
::FreeLibrary(hModule) ;
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Thank you for your help.
But please could you give me the C# code becuase I am not good in C++.
|
|
|
|
|
ass3aad wrote: But please could you give me the C# code becuase I am not good in C++.
Sorry, I don't do C#, but you should be able to figure it out. I don't think the two languages should differ that much. The flow is the same as in any language and the API calls made are the same.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
use:
String s = regsvr32 + "File name";
System.Diagnostics.Process.Start(s);
Cheers
"Peace of mind through Technology"
|
|
|
|
|
How can i open the create olap cube wizard?
|
|
|
|
|
Hello,
I am trying to develop an addin for Visual studio 6.0(msdev.exe).
I am using DevStudio Add in Wizard for it.
It provided me default code for handling application events and debugger events.
But my objective is to handle copy,cut,paste ,print commands in editor.These command are not the part of IApplication events or IDebugger events.
Could anybody please help me in
finding the best possible solution for this.
As per my understanding Cut,Copy,Paste methods are part of ITextselection interface ,which i try to implement in my class,but unable to handle those events as there is no proper event passing.
Thanks and regards,
Ruhina.
|
|
|
|
|
hi ruhina,
it would be great helpful, if u post some samples on Dev studio add-ins.
Regards,
Prashanth.v
|
|
|
|
|
voorugonda prashanth wrote: it would be great helpful, if u post some samples on Dev studio add-ins.
http://www.codeproject.com/macro/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|