|
Nishant S wrote:
A CFormView is actually a dialog inside a view and now you wanna put this inside a CDialog eh? Geez!
yes but it has scrollbars when you make it too small to show everything. Can you use a CFormView as a standalone dialog?
|
|
|
|
|
hi guys, I have a CALLBACK function whose prototype is LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lparam);
how do I get the ProcAdress associated with this function, I tried:
HOOKPROC hookproc = (HOOKPROC)GetProcAddress(NULL, "MouseProc");
and
HOOKPROC hookproc = (HOOKPROC)GetProcAddress(hInstance, "MouseProc");
both returned 0. what's the right way of doing it?
thanks a thousand
|
|
|
|
|
It looks as though you are trying to get the address of a function within your current project. If so, just:
HOOKPROC hookproc = MouseProc;
If it is in another module, then you should call GetModuleHandleEx() before calling GetProcAddress(). You need a valid HMODULE to pass into GetProcAddress().
Cheers
|
|
|
|
|
thanks that helped. I have another question: how do I get a mouse_pressed_down message in my MouseProc function, I can get the mouse coordinates, I want to be able to detect a press on the desktop, not on any particular window. would you provide me with some details? thanks
LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lparam){
MOUSEHOOKSTRUCT* mousehook=(MOUSEHOOKSTRUCT*)lparam;
POINT p=mousehook->pt;
char temp[20];
sprintf(temp,"mouse position is %d %d\0",p.x,p.y);
MessageBox(hWnd,temp,"",MB_OK);
return -1;
}
|
|
|
|
|
If you mean a message like WM_LBUTTONDOWN, just look for it in the wParam of your MouseProc. Regarding hooking the desktop window, I have only hooked app windows, so I recommend you tinker to find out. It might be useful to know that the desktop is the absolute top of the window hierarchy, and has no handle (many functions take a NULL hWnd to signify the desktop). Beware that it seems you might have to do global hooking to accomplish this, which should not be done for extended periods, as the entire system would be negatively affected. Don't be surprised if you have to reboot several times while experimenting!
Cheers
|
|
|
|
|
Hello!
Maybe somebody know method to create VS.NET-like docking windows and toolbars using standard
windows controls or COM-objects. I know, that explorer-bar is a COM-object. That's why I suppose that this windows and toolbars could be a COM-objects.
Thanx!
|
|
|
|
|
|
Hi all,
I'm using SAPI 5.1 to develop a text-to-speech application. What I want to do is to be able to asynchronously output spoken text to a wave file and to be notified when that wave file is finished being written. I have set up an event handler using the following calls (with error checking removed):
m_pVoice->SetInterest(SPFEI_ALL_TTS_EVENTS, SPFEI_ALL_TTS_EVENTS);
m_pVoice->SetNotifyWindowMessage(hWnd, UWM_TTSEVENT, 0, 0);
The m_pVoice variable is of type CComPtr<ispvoice>. In order to speak to a wave file, I use a CComPtr<ispstream> object that is bound to a file.
I am able to receive events whenever I call m_pVoice->Speak to speak text to a default audio device. However, if I want to speak to a wave file, the UWM_TTSEVENT message never gets fired.
The thing is, I need to know when the file is completed so that I can close it and clean up, and I need to be able to speak to multiple wave files at once.
Is this a SAPI limitation?
Thanks!
--Two Magic Lovers
|
|
|
|
|
For some reason, my code to reverse the order of a string is incorrect. Please help.
void reverse_string(int execute_mode, char * sPtr){
if (!execute_mode)
cout << "Reverse the order of characters in the current string\n";
else {
int len = strlen(sPtr);
char * ePtr = sPtr+len-1;
for (int i = 0; i < len; i++)
swap(sPtr+i, ePtr-i);
}
}
|
|
|
|
|
|
Let me guess, you end up with exactly the same string that you put in?
The problem is this:
s+i = e - len
e-i = s + len
Therefore when you reach len/2, your string should be completely reversed, however you continue to swap from len/2 to len which basically swaps all of the strings back to their position.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
This isn't homework is it?
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
Even if is was, give him credit for following the forum guidelines. He tried on his own first and made some progress, but got stuck and came here. He posted what code he had so far, which shows that he didn't expect someone else to do his work for him.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have several buttons in a dialog based program. I want to be able to click or press enter on one button and have the focus move to another button. I have gotten the focus to move using:
GetDlgItem(BUTTON_NAME)->SetFocus();
However when I press enter the nothing happens because the button isn't highlighted.
How can I fix this?
Could I fix the problem by setting the default button instead of changing the focus. If so, how would I do that?
|
|
|
|
|
SendDlgItemMessage(hDlg, <ID of current default push button>,
BM_SETSTYLE, BS_PUSHBUTTON, (LONG)TRUE);
SendMessage(hDlg, DM_SETDEFID, <ID of new default push button>,0L);
SendDlgItemMessage(hDlg, <ID of new default push button>,
BM_SETSTYLE, BS_DEFPUSHBUTTON, (LONG)TRUE);
Try this code. DEFPUSHBUTTON is what you need to change, no the focus.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Your suggestion worked with the following changes.
1) The functions do not take the hDlg parameter.
2) SetFocus() is needed to point the keyboard to the default button.
The revised code follows:
SendDlgItemMessage(<ID of current default pushbutton>, BM_SETSTYLE, BS_PUSHBUTTON, (LONG)TRUE);<br />
SendMessage(DM_SETDEFID, (<ID of new default pushbutton>, 0L); <br />
SendDlgItemMessage(<ID of new default pushbutton>, BM_SETSTYLE, BS_DEFPUSHBUTTON, (LONG)TRUE);<br />
GetDlgItem(<ID of new default pushbutton>)->SetFocus();
|
|
|
|
|
Excuse me is there any ActiveX for Control the Bitmaps or Images and Draw them or it can change the position of images ???
something for managing images.
if u want to know what i am going to do plz See this AVL tree :
http://www.seanet.com/users/arsen/avltree.html[^]
regards
|
|
|
|
|
hi everyone,
i tried to create a installer for my application using visual studio .net's 'setup and deployment project'/'setup wizard'/'create windows installer'. my project name is 'setup'. i create the installer after i choose all the files that i wanted to be included in the installer and 5 files are created. they are: setup.msi(88kb), setup.ini(23b), setup.exe(65kb), instmsiw.exe(1.8mb) are instmsia.exe(1.7mb). btw, i'm running winxp pro.
my questions:
1) how do you create an executable installer with just 1 file(that will install the application) instead of 5 files?
2) what are the uses of instmsia.exe and instmsiw.exe? i've tried to install the application with these 2 files removed(instmsia.exe and instmsiw.exe).. my application is still installable without these 2 files.. can i just distribute my application without these 2 files? since my application is small in size and these 2 files are taking up alots of space..
|
|
|
|
|
Hello,
Q1: I dont think its possible using VS.Net
Q2: the files that you have mentioned are requied to install the windows installer service if the same is not present on the target machine. The service in available by default in W2K and above. if the service s not found then setup.exe installs the installer service using these files, and then proceeds to the installation of your package.
For more information check out the windows installer documentation / SDK available on MSDN.( Sorry i dont remember the exact link)
regards,
M$
|
|
|
|
|
i have a problem.
i want to Drag-n-Drop some bitmaps in the main window.
for this job i can use CImageList that do this job, but it can only Drag one BITMAP per each Drag-n-Drop Opearation.
i can Draw Bitmaps on Main window and capture Mouse movement and when i want to drag a bitmap fisrt Clean the Previous Bitmap and then Draw the new one. but if i do this the Sence will flicker badly.
i can use some CWnd Object in the main Window and then Draw the Bitmaps in them and then Control the position of Windows by Capturing the mouse movement. i don't like this one i dunno why.
So if there are any other Technique plzz tell mee. i realyy need itt
|
|
|
|
|
-=Ehsan-de-Burge=- wrote:
i don't like this one i dunno why
I dunno why either, because it's the nice way to do it.
Draw in OnEraseBackground to eliminate flicker. Double buffering is also nice. Check out some CP articles on flicker to help here.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thanks mr Christian. i think in Visual Section u r the Mastership of this Site.
best Regards.
|
|
|
|
|
When I build a UNICODE project, it always result the error below:
LINK : fatal error LNK1104: cannot open file "c.lib"
but I did not use the c.lib library at all,
who can please tell me the reason?Thanks.
|
|
|
|
|
1. search your include files for something like(might not be exact) :
#pragma comment( lib, "c.lib" )
2. recheck your linker settings for additional dependancies
|
|
|
|
|
thank you for your reply.
Sure,I have check all of above,but find nothing
It puzzle me too much
|
|
|
|