|
Has anyone tryed a USB comunications object for sending data to a divice connected to ther USB port
Rich
|
|
|
|
|
Hi
I have a dialog-based application, where a user can either click on buttons or use the keyboard.
Since there are many buttons, I have handled mouse button clicks in the OnCommand handler. Now, I don't want to duplicate keyboard messages. So is there a way to map the keyboard messages to the mouse clicks?
Regards
Sridhar J
|
|
|
|
|
You should rather map keyboard messages to WM_COMMAND directly using accelerator table.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hello
Thanks for your quick reply.
What I want to do is something like in the windows Calculator. When a number is pressed on the keyboard, the button acts as if it is clicked and the same code as a button click is executed. How do I do this?
Regards
Sridhar J
|
|
|
|
|
sridharj wrote:
When a number is pressed on the keyboard, the button acts as if it is clicked and the same code as a button click is executed
In this case, handle WM_KEYDOWN or WM_CHAR and send BM_CLICK to appropriate button. You'll probably want to map key codes to button control IDs to avoid huge switch(...) statement. Use CMap or std::map for that.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hello
Thank you very much. Although, I usually do not post thank you messages too often, since it wastes the other persons' time, I feel I can make an exception here.
Please look out, since I have a lot of questions.
Each will have its own thread, since people can read and learn without asking again.
Regards
Sridhar J
|
|
|
|
|
I want to change the cursor to an Hourglass while my program is busy. I thought this would be simple but I cannot find it my books, in the help or on CP, maybe I'm searching for the wrong thing!
Anyway, can anyone tell me how to do it or where to look.
Cheers,
Ali
|
|
|
|
|
BeginWaitCursor(), to change to hourglass
then EndWaitCursor() when done.
chin
|
|
|
|
|
Excellent, thank you very much. I thought it should be simple, just couldn't find it.
Thanks again,
Ali
|
|
|
|
|
Either the Begin..End functions given in the other post, or my personal favourite (if you're using MFC, that is) - add a CWaitCursor object to your functions's variables like so
void CMyClass::DoSomethingThatTakesAges()
{
CWaitCursor xWait;
.. do whatever processing you want here as per usual..
}
Whilst the CWaitCursor object lives, it'll make your mouse pointer into an hourglass, so you can easily drop these as the first line of any function that does any kind of long period of processing (and they can stack quite happily - the mouse stays as an hourglass as long as there is at least one CWaitCursor object alive)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
That's neat, and it will fit nicely into my code. Thanks for the tip .
Ali
|
|
|
|
|
Hello,
I am a "new hand" of MDI
I want to know how to open different type of view at the same time in MDI and pass through the data between between it.
or How to open another view when I click the menu bar?
Thx you very much!!!!
Calvin Wong
|
|
|
|
|
Hi,
I will be opening an url through Shellexecute() command.
ShellExecute(hwnd,0,szCommand,0,0,SW_NORMAL);
If my szCommand="file:///f:/mypage.htm#my_cursor"
then it opens mypage.htm but it never points to my_cursor paragraph.
But if i open explorer & copy the above text,it points to particular paragraph.
How can achive this with shellexecute() command?
Thanks
Neha
|
|
|
|
|
Hi
Try using CreateProcess with the name of the application (here it is IE) with a switch style parameter like:
<br />
Iexplore.exe /file:
I am not sure abt this, but you can tweak it a little here and there.
Regards
Sridhar J
|
|
|
|
|
i'm writing a context menu extension that creates a file in the currently visible folder. i'd like to force explorer to select that file and scroll it to be visible, or even better, scroll it to be visible and start the filename editing process.
i've looked everywhere i can think of, but found nothing.
has anyone done this?
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Not sure if this does it, but maybe.
You could try calling IShellBrowser::BrowseObject() with
SBSP_SAMEBROWSER and the pidl to your newly created file.
I *think* thou can get the IShellBrowser with SHGetInstanceExplorer().
If you want to edit you must somehow get hold of the IShellView
and call SelectItem() on it.
I belive there is an undocumented msg you can send to the explorers
mainwindow to get the IShellView.
..but forgotten what it was.
WM_USER + 7...maybe..
IShellBrowser::QueryActiveShellView() should do the trick
(Where is the new cool edit toolbar when modifying messages?
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
1. I drawed my BITMAP in primary surface and I would like to know the command using in clear surface.
2. I would like to know the surface using method more than two surface(I require the example).
|
|
|
|
|
You can BitBlt using BLACKNESS as the method ( instead of SRCCOPY ) or WHITENESS if you prefer.
Ta_Tee473 wrote:
I would like to know the surface using method more than two surface(I require the example).
What you talking about, Willis ?
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Hello
I want to update menu when user select an other language.
I call "ModifyMenu" then "UpdateWindow" but changes are done only when mouse is going over the text.
Is anybody can help me?
|
|
|
|
|
You may want to try using RedrawWindow instead. You could also try using the UPDATE_COMMAND_UI which is called continuously when the menu is displayed.
Hope that helps
Dor
|
|
|
|
|
Thank you.
I used "DrawMenuBar" and it's is allright.
|
|
|
|
|
I have vb program.It has only one form.I am running my exe which is written in win32 application in vc++.i want to draw the lines on the vb form by using the vc++ program exe.
|
|
|
|
|
suresh_sathya wrote:
I have vb program.It has only one form.I am running my exe which is written in win32 application in vc++.i want to draw the lines on the vb form by using the vc++ program exe.
The first thing that comes to mind wrt communication between programs written by different languages is a DLL
( or maybe COM ). You could have your DLL, written in VC++ that your VB program can use in its program.
If the (VB) program is already build, I guess you could always try and subclass the window (form) and directly
draw on the surface.
Post more info on these programs. Are they in development, or are they already build and cannot be changed? Why VB and VC++, can you not convert one to the other?
I'm sure if its possible then someone outthere will post a reply
china
|
|
|
|
|
I am writing a simple console application with MFC support in order to connect to Database using ADO. But having problems in the initial stages.
The main program looks something like this:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
_ConnectionPtr m_pConnection;
HRESULT hr;
if(!AfxOleInit())
{
printf("\n COM initialization failed");
}
hr = m_pConnection.CreateInstance( __uuidof( Connection ) );
if (SUCCEEDED(hr))
printf("\n createInstance successful");
else
printf("CreateInstance unsuccessful");
The problem is that CreateInstance is failing. Please tell me the problem if you find out.
Oh yea, i added following lines in StdAfx.h:
include <comdef.h>
#import "C:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
|
|
|
|
|
You need to initialise the COM library by calling ::CoInitialize()
eg:
if( FAILED(::CoInitialize(NULL)) )
{
AfxMessageBox(IDS_ERROR_COM_INITIALISE, MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
Chin
|
|
|
|