|
I will doubt whether there are multiple copies of data inside DLL (e.g. static member variable of a class) if we call LoadLibrary multiple times inside one process? Any ideas?
regards,
George
|
|
|
|
|
Well, I made a little test, getting the same HINSTANCE value when calling two times LoadLibrary using the same DLL file as argument, hence no multiple copies (at least on empirical grounds...).
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
|
|
|
|
|
Thanks CPallini!
Seems Windows protects from loading the same DLL twice inside the same process?
regards,
George
|
|
|
|
|
Or maybe it gives out sparingly system resources.
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
|
|
|
|
|
Thanks CPallini.
regards,
George
|
|
|
|
|
In my programm a barcode is needed. This barcode is scanned with a barcode scanner on a serial COM port (COM1 or COM2).
How do I programm this serial communication?
Please keep in mind that I am less than a juvenile in the C++ programming business and I am learning it the hard way (no training).
|
|
|
|
|
You need to have some documentation about the protocol which is used by the barcode device.
|
|
|
|
|
The Barcode scanner works on a serial protocol with a known baudrate, databits, stopbits and so on. If I monitor the scanner with Hyperterminal I see the scanned code as a plain text (ASCII).
|
|
|
|
|
Yeah ok but you need to know what to exchange with the scanner. Don't you have some documentation somewhere ? Can you communicate with the scanner using Hyperterminal ? Do you know which commands to send ?
|
|
|
|
|
The scanner sends me an ascii code (bar code consists of 7 numbers). This code is send when the operator presses the scan button on the scanner (hand held). Programming of the scanner is done with bar codes (available in the manual of the scanner). Here is also an explanation on how this is done with a serial port in combination with a terminal emulation programm (eg like hyperterminal).
The used scanner is a HandHeld IT3800G (supplied in the Netherlands by Sick)
|
|
|
|
|
From your conversation with Cedric, you just need to know how to read from the COM port using a prgram you've written.
This is not a two line process, as it is inherently asynchronous. Luckily, there are a few classes here on codeproject that will help you. Just search for serial communications.
Also, this website may help: http://www.flounder.com/serial.htm[^]
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
I want to thank you all for your help and information about this problem..
Iain: your link to flounders.com did the trick in combination with the next aticles:
Creating a Serial communication on WIN32 by Konchat
Serial Communication in Windows by Ashish Dhar
and a MSDN article about the same issue: Serial communication in Win32.
Thanks to you all...
Frank.
|
|
|
|
|
I have created some bitmaps and want to add button control to it.
For example, I want the bitmap to have control such that when it is clicked on,
another dialog form can pop up.
I am working on Visual C++ environment, MFC .
Ema
|
|
|
|
|
If you just want to open another dialog by clicking on bitmap, you can do following:
1. Use picture control to display bitmap.
2. Add OnClick event of PictureControl.
3. Write code to call another Dialog inside OnClick method.
Mukesh Kumar
Software Engineer
|
|
|
|
|
Thanks for the prompt reply.Appreciate it.
I use picture control to display the bitmap.
But then ,the problem I am facing now, is that, there is no OnClick event that I can add.
So what do I do?
Ema
|
|
|
|
|
Did you see CBitmapButton?
|
|
|
|
|
No I don't see the CBitmapButton.How to?
Do i need to add this class?
Ema
|
|
|
|
|
|
I found a simple way to display the bitmap buttons on my main dialog form.
But now I want to display the same bitmap buttons on the other dialog forms
in the same project, but it isn't appearing at all .
Ema
|
|
|
|
|
Did you try with this event WM_ERASEBKGND?
|
|
|
|
|
No,I didn't.Must I add this function?How can it help?
Ema
|
|
|
|
|
See here[^] if you have any question you can ask.
|
|
|
|
|
The method in that article is used if there is a smaller dialog window overlapping on the main dialog window.
Am I right?
But,
My aim is to close the main dialog window.Then appears the next dialog window
which is supposed to display the new bitmap buttons.
Have I missed something important that these owner drawn bitmap buttons are not visible?
Below is my test code snippet:
BOOL CResultsModuleDlg::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bReturn = CDialog::Create(IDD, pParentWnd);
if (bReturn)
{
m_bmOrangeButton[1].AutoLoad(IDC_BITMAPBUTTON_ORANGE1, this);
}
return bReturn;
}
Ema
|
|
|
|
|
Do you want to play image on the Button or On the Dialog?
|
|
|
|
|