|
Handle how?
If my question seems ambiguous then it is because your question is.
|
|
|
|
|
hi Sam,
I have to communicate with a palm print device to check for a valide palm print.
How could I manage to do it in C++ (under Windows & Linux environments), if there is no DLL for the Device.
Is there any help about such type of problems i.e. Device Handling in C++ or VC++.
If you have any information regarding this topic please let me know.
Thanx,
Riz.
|
|
|
|
|
You say it is a "palm print device"; is it a parallel interface?
Do you have documentation of how to do communicate with a palm print device? Does it say anything about "IrDA"?
|
|
|
|
|
hello,
I have a seemingly simple task. I have a dropdown combobox which I use to present a list of 'things' that currently exists. The user is also free to type something in the edit box.
I want to handle the following events:
1) The user selects something from the dropdown listbox - I then present the details about that 'thing'
2) The user types something and hits RETURN, and if it exist in the dropdown listbox I present the details about it, as above.
3) The user types something and hits RETURN, and if it doesn't exist in the dropdown listbox I create the 'thing' and clear the form so he can type in the details if he wants.
4) Bonus: If the listbox is in dropped-down mode, I want incremental search in the listbox while/if the user types something.
This is what I have done: I have a handler for CBN_SELENDOK. There, I have to check GetCurSel() and GetLBText() here. UpdateData() doesn't work. Why? But OK, I can handle the situation where the user selects an existing item.
How shall I best trap the RETURN key? Subclassing, i suppose. I have tried that but currently I get stuck in a weird situation where I click on the down-arrow but the combobox doesn't drop down!?! Strange huh!?
BTW, Which is the best way of notifying the CComboBox about the keypress in the subclassed CEdit?
Any ideas about why these suposedly simple things are so complicated to perform?
Thanks
Peter
|
|
|
|
|
I'm loading and decoding TGA, and JPEG's into a BYTE * on the freestore, and I have the width, height, etc of the image, but I dont know how to put it all into a HBITMAP so it can be drawn on a window (Aim-drawing on a tree control). If anyone has any ideas, please reply!!
Thanks.
|
|
|
|
|
Use SetDIBits(...) method.
"INFO: Rotating a Bitmap by 90 Degrees" MSDN article could give you more hints.
|
|
|
|
|
I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app.
I dont want to have this Text in the Form (Document - Application).
I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when
I want to change the Text to appear while starting.
Where should I put my code?
What function should I use
Thank you
|
|
|
|
|
To change the Window title you must use the SetWindowText() function as folows:
1- Override the function PreTranslateMessage() in the MainFrame Class
2- Write the SetWindowText() function here.
Regards,
Rizwan Majeed.
|
|
|
|
|
|
That's a little extreme. All you need do is remove the FWS_ADDTOTITLE style from the window and then change the IDR_MAINFAME string to say whatever you like.
|
|
|
|
|
Hi DiDi,
I haven't done this myself, but I have done this with Dialog Based apps, so I am making some assumptions here.
In your SDI, in the View class, there is a function OnInitialUpdate(). This function is called after the window is 'created' but before it is actually displayed on the screen.
In order to set the window text, the window must exist. But, I understand that you want to set the text before the window becomes visible. The aforementioned function is the perfect place to put such code.
In your View class, override OnInitialUpdate(), call the base class CView::OnInitialUpdate(), and then add your code to change the name of your window before this function finishes.
Hope this helps
Jeff
|
|
|
|
|
http://home.socal.rr.com/samhobbs/VC/ChangeTitle.html
|
|
|
|
|
Hello,
I've downloaded and used the BandObjs MSDN sample which shows how to create an Explorer Bar.
However, what the sample fails to show is how to communicate between the Explorer Bar and Internet Explorer itself.
What I need to know how to do is the following:
1. When the user enters a new address or clicks on a Favorite, I need my Explorer Bar to know what the new address is.
2. I would like to also be able to *Set* the address of the Browser (IOW "goto" a new website in the same browser window that my Explorer Bar resides).
Thanks much for any articles or help.
- Robert Thompson
|
|
|
|
|
To know when the user goes to a new URL, write a browser helper object. It gets notified when the browser navigates to a new URL. You can then use standard IPC techniques to communicate with your explorer bar.
|
|
|
|
|
Thanks Michael,
Do you know where any sample code is for this?
This kind of thing is difficult w/o some samples to look at.
- Robert
|
|
|
|
|
If you are already developing an explorer bar, you don't neccessarily need a browser helper object. In your SetSite implementation of your explorer bar, you should be getting the IWebBrowser2 pointer, similar to the code snippet below. Then you can do an Advise on the webbrowser to recieve the events it dispatches of DWebBrowserEvents2. Then you can see when the URL changes. Or you can use the web browser object to make a call to Navigate or Navigate2 to move to a different URL of your choice.
IOleCommandTarget* pCmdTarget;
hr = pUnkSite->QueryInterface(IID_IOleCommandTarget, (LPVOID*)&pCmdTarget);
if (SUCCEEDED(hr))
{
IServiceProvider* pSP;
hr = pCmdTarget->QueryInterface(IID_IServiceProvider, (LPVOID*)&pSP);
pCmdTarget->Release();
if (SUCCEEDED(hr))
{
if (s_pFrameWB)
{
s_pFrameWB->Release();
s_pFrameWB = NULL;
}
hr = pSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, (LPVOID*)&s_pFrameWB);
_ASSERT(s_pFrameWB);
pSP->Release();
}
}
|
|
|
|
|
I want to start a process on a NT Server machine from my NT Workstation. Please give me some ideas of how I can do that.
I need to write both the client and server process.
Thanx,
Jagadish.
|
|
|
|
|
I do not know much about RPCs except that they are technical and complex, but they might be just the thing for you. I am 95% sure that DCOM uses RPC for it's inter-system communication. Perhaps there is a good DCOM solution; at least then you will be using current Windows technology. I think that there are some articles that say that since DCOM uses RPC, and since RPC is standard technology, DCOM can sometimes communicate with non-Windows systems that do not have DCOM. If you use RPC directly, then you will probably have a very portable solution, in case that matters.
|
|
|
|
|
Hi,
I am using an electronic device that uses parallel port to communicate with the computer. The problem is that: This device is used to record some sound (It has an ADC converter on it.) By using an assembly program in DOS, i was able to record the sound at 8 KHz. However, i cannot record the sound under Windows.
How can i notify my program every 1/8 ms?
Or how can i pause my program at a specified line for 1/8 ms long?
Thank you for any helps in advance!
Mustafa Demirhan
|
|
|
|
|
I have two program - one design by delphi ,I have source,the other design by VC,I can't change it,The
second program send a message to the first,the message include a data struct like:
struct
{
int a;
int b;
LPSTR *pFilePtr; //what's this?
}
how can I get the message and controrl it?
please give me a sample by delphi or C
Thanks
|
|
|
|
|
You can't pass a pointer to your structure in a message wParam or lParam, because the two programs have different address spaces.
As far as I know you have to use the WM_COPYDATA message, refer to MSDN for details, I never used it.
Otherwise you may try some other way to communicate with another process, such as mailslots, named pipes, memory mapped files ...
Hope this helps,
Paolo.
|
|
|
|
|
Can I made a DLL and share a shared struct then I call the DLL,and He send data to DLL ?
|
|
|
|
|
When you load a DLL into different processes its code runs in the calling process address space, so you can't.
However there's a way to use a DLL to share some memory between processes, but I don't know it in details (you define a shared memory section in the DLL).
I think a WM_COPYDATA msg is the simplest thing to just pass a structure. If you need info go to:
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/winbase/ipc_2mw1.htm
Paolo.
|
|
|
|
|
I'm using Win98, Visual Studio/C++ 6.0, writing a simple Win32 Console App, such as Hello World. The dos console window produced is 80x25, and captures only the last 25 lines written to it.
How can I capture more lines and print them out?
Rick Marshall
SAIC @ China Lake
|
|
|
|
|
This can change the number of lines in the console - you'll need to #include <windows.h>
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
if(hConsole != INVALID_HANDLE_VALUE)
{
COORD size;
size.X = 100;
size.Y = 500;
SetConsoleScreenBufferSize(hConsole, size);
}
And I think you can read the output with ReadConsoleOutput. There are other fns for sizing the window size - SetConsoleWindowInfo - etc. Check the console reference in the MSDN.
|
|
|
|