|
I really don't see the relation with a virtual COM port . Which kind of device are you using that creates the virtual COM port ?
Could you please elaborate a bit because I don't understand your setup.
|
|
|
|
|
Sorry about that, lets try that again.
The device refers to two parts: a micro-controller and a Ethernet 2 Serial(E2S) converter. Which is connected to each other. The E2S communicates with the windows based software via the Ethernet cable. Thus I was thinking of making use of a virtual serial / Ethernet connection to communicate with the device(s). Please note that there could be more that one device / controller connected in the network.
But the thing is that the software for the E2S must be developed in such a manner to complete the communication flow between the PC software and the micro-controller. That is the tricky part. Thus I was looking for some code to get me started on this journey.
Hope that makes sense.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Hope that makes sense.
Not really. Your statements are extremely cryptic in my opinion and I cannot figure out what your asking. I have completed around a dozen serial to ethernet and serial to PIC microcontroller projects and have found the com0com project to be very useful. Here is the link:
Null-modem emulator[^]
Hope it helps,
-David Delaune
|
|
|
|
|
Sorry about that.
Thank you David for the info.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
I had create a 4 picture control box in my dialog. I will allow user to click on the loadImage button to load the picture, the load picture is using opencv function, cvLoadImage(). I had success to load the picture, but how can i display in that picture control box? anyone can help me?Thank you.
|
|
|
|
|
hi,you can use CBitmap class and there are lots of samples about showing a bitmap in the dialog, you can find it out in codeproject, and you also can get the sample from me. MSN:zhu_lin4103@126.com
I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com
|
|
|
|
|
Hi all,
I want to find a string from another string.
so i want to know maximum option those are used here for find string/substring or compare string.
some of them i already use.like::
1.CStringT::Compare
2.CStringT::CompareNoCase
3.StrStr Function
4.StrStrI Function
5.CStringT::Find
if some other function please tell me.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
u missed a couple in CString
CString::FindOneOf()
CString::ReverseFind()
Величие не Бога может быть недооценена.
modified on Wednesday, August 12, 2009 5:33 AM
|
|
|
|
|
some functins in the C Run-Time Library.
_mbsnBcmp
_mbsnbcmp
_mbsnbicmp
_mbsnextc,_strnextc,_wcsnextc
I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com
|
|
|
|
|
hi
i have one file of wave-Mpeg layer3 11025 16 channel 1.
mciSendstring can be load this mp3 and play it but doenst work correctly
when i get position by samples mcisendstring give me wrong. or give me wrong time .
i want to load mp3 and seek by samples and get position by samples.
do u have any way?
thanks.
|
|
|
|
|
hi,I used to player media file by using DirectShow SDK and work well.
I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com
|
|
|
|
|
thanks .but can be directshow sdk seek by samples.
|
|
|
|
|
of course. I can give you an example about playe media file. also you can find some examples in the sdk which must be useful for you.
I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com
|
|
|
|
|
this is a MFC application, you scroll the slider and seek the position of the media file using DisrectShow.
void CSimplePlayerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if (pScrollBar->GetSafeHwnd() == mSliderGraph.GetSafeHwnd())
{
if (mFilterGraph)
{
double duration = 1.;
mFilterGraph->GetDuration(&duration);
double pos = duration * mSliderGraph.GetPos() / 1000.;
mFilterGraph->SetCurrentPosition(pos);
}
}
else
{
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
}
I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com
|
|
|
|
|
seek by samples not by ms
i means "time format samples"
thanks
|
|
|
|
|
I want to use a dll in Visual C++ (Active X control), and for that i did the following:
ClassWizard->Add class->From a type library
Now i have the files that I need (.cpp and .h), but when I invoke a method, I get this message in my output:
"Warning: attempt to call Invoke with NULL m_lpDispatch!"
And the method does nothing. I think I have to create a LPDISPATCH object, but i don't know how. Any help???
My dll file name is "HanBarcord.dll".
and class name in the dll file is "Cbarcord".
I think I have to create the pointer to the real COM's IDispatch.
So, I'm trying to use the object's CreateDispatch function member.
But I don't know what I should put into parameter of "barcordreader.CreateDispatch" exactly.
COleException *e = new COleException;
Cbarcord barcordreader;
barcordreader.CreateDispatch(" ????????????? ", e);
Thank you in advance .
|
|
|
|
|
You should pass the CLSID or the ProgID of the automation object, see [^].
You may also get better help posting at the COM forum [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The CLSID, which should be recorded in the typelib somewhere.
I prefer using #import, which exposes the whole of a type-lib, including the CLSIDs.
Here's an example - I'm using Excel's _Application class (it's a COM class - you could use it via MFC's 'Add Class' route:
#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 main(int, char**)
{
CoInitializeEx(0, COINIT_APARTMENTTHREADED);
{
Excel::_ApplicationPtr xl;
if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
{
std::cout << "Getting name\n";
std::cout << xl->ActiveWorkbook->FullName << std::endl;
}
}
CoUninitialize();
}
If you're using VC6 (which I'm guessing you are?), I'm not sure how well #import will work for you, though
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I am trying to convert wchar[] content to byte[]... but to my surprise, all the suggested methods went in vain..
i used widechartomultibyte,wcstomobs .... they all reproduced "???" marks instead of characters, when i use Chinese or japanese content..
can anyone help me how to convert content without any loss??
Aim: my objective is to read byte by byte of wchar[] content and convert it to byte[]..
i'd be graterful to your reply.
Thanks,
Rajesh.
|
|
|
|
|
You can allocate byte array and copy the data using memcpy. if you're using chinese or japanese characters it's hard to keep in single byte format. wchar_t is two byte so you may need to allocate 2* actual wchar elements to contain everything in the byte array. What is the purpose after converting to a byte array?
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
I suppose you are the same guy as Rakesh5 that posted this question yesterday ? (Why do you create multiple accounts ?)
RajeshRPR wrote: they all reproduced "???" marks instead of characters,
David asked you yesterday where these characters are displayed. Are you inspecting the byte array with your debugger ? If yes, then it is normal that the characters are not displayed properly, because the debugger inspects an array of unsigned chars and not a string.
|
|
|
|
|
Hey Cedric,
I am his friend..We are working together.. i dont know he posted anything like that.. Hence, i posted today.
Have you replied him anything?
Thanks,
Rajesh
|
|
|
|
|
RajeshRPR wrote: can anyone help me how to convert content without any loss??
There is no conversion between Chinese or Japanese and the ANSI code page. If you need to retain the contents and use it as a multibyte string you will need to convert it to UTF8. You can do this by using CP_UTF8 instead of CP_ACP when calling WideCharToMultiByte().
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
I developed an application by using Visual Studio 2005 (Visual C++/MFC based project). The developed exe works fine over the machine that already have installation of Visual Studio 2005. But it does not run over other machine. I even installed the .net2 frameowrk and service pack of .net2 framework as well but did not succdeed in running the application.
I remember that in old days, there was an option of static compilation in Visual C++ (6 version) without .net framework. So how we can do the same in Visual Studio 2005 that is dependant over .net framework. In static compilation, the compiler/linker put all the dependant stuff in exe file.
Please guide me how I can run the application over machines that does not have installation of Visual Studio 2005.
THANKS.
|
|
|
|
|
Madhu_Rani wrote: Please guide me how I can run the application over machines that does not have installation of Visual Studio 2005.
Dynamic linked Visual Studio 2005 C++ applications may require the C run-time and MFC libraries installed on the client machine.
Microsoft Visual C++ 2005 Redistributable Package (x86)[^]
Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)[^]
Another option is to static link your project by choosing 'Use MFC in a Static Library' in the General section of your configuration properties. You will also need to choose '/MT' runtime library in the Code Generation section.
Best Wishes,
-David Delaune
|
|
|
|