|
if u know any thing about com port programing help me please.
thanks for your help
|
|
|
|
|
It depends on the language (and libraries) you intend to use.
I wrote:
(1) VB6 applications using MsComm control.
(2) C++ ones using the Win32 API (CreateFile(), ReadFile(), WriteFile() .
the (1) are fairly simpler, 'cause the (2) are much more low level (and usually you've to deal with threads.
Of course you can also use MsComm control in C++ applications (for instance using MFC). Though I've never done it.
AFAIK the .NET framework provides (so Visual Basic.NET, C#, ...) a SerialPort component that can make communication stuff as easy as MsComm do for VB6 (I never made an attempt). There is also a Microsoft example [^].
hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
My DLL is a normal API without any COM interface i can't use regsrv32 to register my DLL.
How to design a C# COM+ object to wrap my DLL and how to include my DLL using implicit or explicit method.
If have example hope you will post the link thanks.
Regards Stellvia
|
|
|
|
|
Do you really neeed that (you can also use directly your DLL)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
stellvia wrote: i can't use regsrv32 to register my DLL
A DLL is self registering (ie. by calling its DLLRegisterServer known function, in your case regsvr32.exe call this function) when it is a COM server.
stellvia wrote: How to design a C# COM+ object to wrap my DLL
You can use native DLLs from .NET using P/Invoke. Following MSDN article may be of help -
http://msdn.microsoft.com/msdnmag/issues/03/07/NET/[^]
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi All,
I have made an IE Toolbar , using VC++ and ATL . Every thing works fine. But I am always getting my tool bar in the right corner . I need it to be shown in the Center , How can I achieve this Programmatically .
Thanks
George
|
|
|
|
|
Dear friends,
Can I use any alternate for DSO Framer control to display document, excel, ppt, pdf etc files. I tried aspose too, but it was
not meeting our requirements. Because they want a tool which takes the documents as it is like DSO Framer. In aspose to
change the document format we need to change the code also.
And I need to email this document too. So that document may be changed so frequently. And dont forget that document must have
to be made using .Net frame work library(com component is not preferable). What shoud I use in this case. Please help me.
Thank you.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hi all,
I have already made a toolbar for IE, Now my requirement is to make a toolbar
for Mozilla also .But I am not finding any sample source code or help for
that.So how can I make a toolbar for mozilla. Please Help me.
Thanks in Advance
George
|
|
|
|
|
|
Hi Sohail,
Thank you for ur valid information. Actually I have made an IE toolbar using
vc++ ATL COM. It cotains Threads, And many things that mfc supports.
For example,
It consists of a Ticker that shows some information from a server. The ticker
is
actually a class inherited from CStatic. And also Threads in VC++ , that
performs various functionalities like, Collecting data from Server. Showing
Advertisements live , from different sites etc. So I think, I cant perform
these things in Mozilla tool bar made from XML. Right na.
Thanks
George
|
|
|
|
|
well you can certainly do in Mozilla what you have so far created in IE.
From what you said, I beleive your UI logic and Business logic are clubbed together and created only for IE.
If you seperate out the UI logic of toolbar in your IE and put the business logic in a seperate COM dll which is callable from the UI logic then you can invoke the same business logic from within Mozilla toolbar. The UI logic of toolbar is written in XML but there is a way to call COM interface methods. Mozilla also has something called XPCom - COM variant.
I hope this helps
-- modified at 5:59 Tuesday 2nd January, 2007
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi All,
How can i Import the MODI.dll into my visual c++ 2005 project. If you have any articles or sample codes please let me know immediately....
MODI:
Microsoft Office Document Imaging Library
Thankx in advance...
|
|
|
|
|
Dear All,
How to register a COM exe in a different system ?
Thanks.
|
|
|
|
|
Run YourCOMServer.exe with "/regserver" paramter.
YourCOMServer.exe /regserver
Does this work for you?
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi all,
How can i call the com based dll file to my vc++ MFC project.
And i am having one com based DLL,which is only the dll file(like eg. comgs.dll) there is no .h file and .lib file then how can i use it.
Please send any cleared article URL.
Thankx in Advance....
Currently i am using Microsoft Visual studio 2005.
|
|
|
|
|
you want to use that COM dll .. right ?
then you have to register that COM dll in to your system.
To do that pres 'Start' button take 'Run' Applicaiotn, inside Run win type 'Regsvr32' then space your COM dll file location.
for example., you COM file location is C:\\app.dll then
in Run window, type 'regsvr32 c:\\app.dll' press enter
now your COM dll is register wit your system.
then write COM client program using api's like CoInitialize(NULL),CoCreateInsatnce() and CoUninitialize();
This is the way you have to use COM dll.
bye.
|
|
|
|
|
Hi Sakthiu,
That's fine, i have registered successfully but, i didn't know how to used to the client application. i didn't find good and cleared articles.
some articles tells that
AfxOleInit() - COM Initialize.
AfxOleTerm() - COM Uninitialize.
i have really confused. please send any cleared article URL or any sample code...
Thankx...
|
|
|
|
|
This[^] article should give you idea, how you need to use COM interface.
|
|
|
|
|
Hi Prasad,
I had read ur article.It's really usefull for me...
I followed correctly through ur sending article and successfully loading my dll,
but when i clicked the OK button,
1) MessageBox within "s" message and
2) MessageBox within "Failed" message showned and
3) assertion failed would be throwned.
my source code look like this...
void Ctest2_vcDlg::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
CString s1,s2,s3;
s1=_T("c:\\p1.pdf");
s2=_T("c:\\pppp.jpg");
s3=_T("jpeg");
BSTR b1,b2,b3;
b1=s1.AllocSysString();
b2=s2.AllocSysString();
b3=s3.AllocSysString();
typedef HRESULT (WINAPI *pMakeFile) (BSTR,BSTR,BSTR);
pMakeFile MakeFile;
HMODULE hDll=LoadLibrary(_T("comgs.dll"));
if(hDll)
{
AfxMessageBox(_T("S"));
MakeFile = (pMakeFile)GetProcAddress(hDll,"MakeFile");
if(!MakeFile)
{
AfxMessageBox(_T("Failed"));
}
ATLASSERT(MakeFile);
MakeFile(b1,b2,b3);
FreeLibrary(hDll);
}
else
{
AfxMessageBox(_T("DLL Err"));
ATLASSERT(0);
}
OnOk()
}
And comgs library .tlh file look like this....
// Created by Microsoft (R) C/C++ Compiler Version 14.00.50727.42 (931fd62f).
//
// e:\sureshshanmugam\psudocodes\test2_vc\debug\comgs.tlh
//
// C++ source equivalent of Win32 type library comgs.dll
// compiler-generated file created 12/29/06 at 11:26:07 - DO NOT EDIT!
#pragma once
#pragma pack(push, 8)
#include <comdef.h>
namespace COMGSLib {
//
// Forward references and typedefs
//
struct __declspec(uuid("7a474480-a013-11d3-9c8b-00e098055175"))
/* LIBID */ __COMGSLib;
struct /* coclass */ gscript;
struct __declspec(uuid("7a47448c-a013-11d3-9c8b-00e098055175"))
/* dual interface */ Igscript;
//
// Smart pointer typedef declarations
//
_COM_SMARTPTR_TYPEDEF(Igscript, __uuidof(Igscript));
//
// Type library items
//
struct __declspec(uuid("7a47448d-a013-11d3-9c8b-00e098055175"))
gscript;
// [ default ] interface Igscript
struct __declspec(uuid("7a47448c-a013-11d3-9c8b-00e098055175"))
Igscript : IDispatch
{
//
// Wrapper methods for error-handling
//
HRESULT MakeFile (
_bstr_t inputfile,
_bstr_t outputfile,
_bstr_t devicename );
//
// Raw methods provided by interface
//
virtual HRESULT __stdcall raw_MakeFile (
/*[in]*/ BSTR inputfile,
/*[in]*/ BSTR outputfile,
/*[in]*/ BSTR devicename ) = 0;
};
//
// Wrapper method implementations
//
#include "e:\sureshshanmugam\psudocodes\test2_vc\debug\comgs.tli"
} // namespace COMGSLib
#pragma pack(pop)
|
|
|
|
|
surezu wrote: I followed correctly through ur sending article
No , you haven't.
You are mixing simple dll with COM dll.
In case of COM dll, there would interface(s) present. Which you need to use. This interface in your case is Igscript .
You haven't noticed how interface need to be used from C++ client. Look in to CMfcclientDlg::OnOk .
You need to use CoCreateInstance for this purpose.
Refer CMfcclientDlg::OnOk . from article and post back, if got any issue.
|
|
|
|
|
Hi Prasad,
I got result and i knew some basic concepts about COM based DLL.
Thank you very much.
-- modified at 7:30 Tuesday 2nd January, 2007
|
|
|
|
|
hi there,
To be using COM in my final year proj. Can anybody point me out very good reference - Online/literature. it'd of immense help as i need to learn it as a crash course .
plz help
Shouvik
|
|
|
|
|
Refer COM[^] section on this site.
|
|
|
|
|
Thanks Prasad,
Till now all my posts are replied by u first
thanks a lot
Shouvik
|
|
|
|
|
Most welcome !
Hope , it helps you in some way.
Majority of CP'ians are on vacation, otherwise, you will get lots of replies.
|
|
|
|