|
Mr.Prakash wrote:
you will need msvcr71.lib to use that dll.
mMmm...
i just know this way!
<br />
[System.Runtime.InteropServices.DllImport("msvcr71.dll")]<br />
static extern int _kbhit();<br />
<br />
public bool KeyboardHit<br />
{<br />
get<br />
{<br />
return System.Convert.ToBoolean(_kbhit());<br />
}<br />
}<br />
|
|
|
|
|
Oh ok, you know the best how to import it in the C# application, coz i dont know anything about C# atleast for now.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hello all,
I'm presently learning how to use my own message handlers in my MFC application. I read this article: Windows Message Handling - Part 2 here: http://www.codeproject.com/dialog/messagehandling2.asp.
I have a problem with one line of code; when I need to get the CWnd* to send the message.
In my case, I want to send the message to my main view based on CFormView when I'm in another dialog or class.
Here's how I was trying to do it:
pMyMainView = CWnd::FindWindow(_T("CMyMainView"),NULL);
pMyMainView->SendMessage(WM_MYMESSAGE,0,0);
But FindWindow don't find my CMyMainView, so I can't send the message.
I tried "this->SendMessage(WM_MYMESSAGE,0,0);" in my CMyMainView.cpp to verify my message handler and it's working.
It must be so simple! But I started coding in C++ and MFC only 1 month ago.
Thanks,
Dave
|
|
|
|
|
I'm not sure what you mean by "my main view". To get the application's main window, use AfxGetMainWnd() . To get the dialog's parent window, use GetParent() . Hope this helps.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thank You Ravi, I knew it was simple, but...! hehe It worked with GetParent();
|
|
|
|
|
Hi,
I have an existing dialog and I add a tab control from the resource editor. I call the CTabCtrl::InsertItem() function and can add tabs to the control but I cannot put anything in them. I can also create a property sheet and add property pages but my property sheet has an OK, Cancel, Apply and Help button which I don't want. What I really want is to create my tab control and add my property pages to the tab control but I do not know any way to associate property page with tab control.
Please help.
|
|
|
|
|
Why do you want to add propertygpages to the tabcontrol, you will still get the same output as in propertysheet.
if you want to do something to the tab control, then you can get the handle of the tabcontrol that the property sheet is using, by calling gettabcontrol() in propertysheet.
check this out and then deside wheather this is good enough.
If you want your tabcontrol to work then you can simple subclasswindow the default tabcontrol to ur tabcontrol.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
A tab control is not a property sheet. A tab control is only the "tabs" part of a property sheet. There are couple of things you can do:- Create child window dialogs for every page. Create a custom tab control that displays a specific child window in response to a tab selection. This isn't hard but is non-trivial. I'll post an article that has a canned class that you can use, soon.
- Use a modeless CPropertySheet. See this[^] MSDN article for instructions.
Hope this helps.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I wrote a small program that changes the screen resolution (800x600) then it runs a FLASH projector application (flash.exe) using CreateProcess function. On Win9x, Win2000 it works properly, but in WinXP FLASH application is minimized and in background. I set STURTUPINFO dwFlags and wShowWindow members.
|
|
|
|
|
|
I did it. I'm waiting for process termination using while loop, and i don't refresh the main program window. Just before running the process I changed screen resolution and maybe the window needs refreshing. FLASH program is child process of main program.
|
|
|
|
|
I have a MySQLDac result set from a query in delphi 5. I'm trying to see if I can write a DLL in VC++ 6 where I can click my "Export to .dbf" button in my Delphi project, and it will export it to a DBase table. Can anyone help? ;);P ((
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I need to blit a bitmap to the screen as fast as possible (it's showing video) and I'm assuming DirectDraw would be the best way to do this. Having never done any coding with DirectDraw I'm a bit lost where to start.
I'm also confused about the relationship between Direct3D and DirectDraw - some of the samples I've found for DirectDraw use functions which don't seem to appear in Direct3D - but I understand DirectDraw has been merged with Direct3D, so I guess I'm missing something here!
To make life a little more complex my bitmap is a DIB which uses an 8 bit format (i.e. the bits index entries in bmiColors). I have found some references to creating a DirectDraw surface in client memory but they don't seem to support this type of format (or do they?)
Any help gratefully received.
Thanks guys.
|
|
|
|
|
If you are showing a video you should use AVI format not a series of bitmaps. All the hard work has been done for you there.
If you are still interested in your present course you should use DirectDraw. DirectDraw is mainly built for game design - layered / transparent / alpha blending / movement of images. I believe they use 24-bit color.
DirectX is not a quick read, and if you have any control you should probly just use MFC SelectObject. In that case you must render into the draw context of the video capbilities in a buffer then blit it to the area of the screen.
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
I'm actually generating the video images myself so AVI isn't relevant to me. At present I'm using a solution based on SetDIBitsToDevice which works well it's just not really fast enough - for example on a PIII 1GHz a 464 x 464 bitmap takes about 12ms to get blitted when the screen is in 32 bit colour mode - that's too slow for me, hence I'm thinking of using DirectX. I'm aware that DirectDraw is the solution I need, it's just that in DirectX 8.1 DirectDraw was merged with Direct3D, or so I've read, and I can't find the DirectDraw functions in the SDK documentation anymore.
My real hope was that someone out there would have a ready made DirectDraw blitter, or at least could point me at some references.
Thanks for your comments.
|
|
|
|
|
please help me
i want to print a grid (flex grid ver 8.0) in a dialog in MFC
please help me
|
|
|
|
|
Hello,
How can I getting the background color of the system tray. I is looked in the listing of system colors but this is not being there. I is sawed this before so I knowing this is possible.
Thank you
|
|
|
|
|
I dont know why you really want to do that, any ways you have to subclasswinddow the wndproc and do any appropriate drawing of the background color...
the systray windproc can be found using this wndclass "TrayNotifyWnd"
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Thank you. Is works, but not in XP. XP is uses a nother draw. I thinks is bitmap. How is getting this bitmap so I can using it to fill?
Is greatful for you doing much helpful
|
|
|
|
|
You need to get hold of the window name, in XP it must be different, or it must using some other way of drawing the taskbar.
Use Spy++ to get the window name.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
I have created a dialog based appl. but I wanna add more pages but can't seem to get it right
I have tried to do that with adding dialogs but I'm getting problems
can someone help me
|
|
|
|
|
hi
im just starting to learn mfc and i cant
find how to do the stuff i need, what i need to do
is something like explorer(not iexplorer).
i need a clean window with only a start button+task bar, pressing start will open a dialog above it and let you choose from availble programs, pressing a program will run and and also show up in the task bar, just like the interface of windows ( no need for quick-lunch yet)
since im new , please give me full answers including what controls do i need to use and any suggestion, if someone did something similar, an example will be great
Gonen
|
|
|
|
|
gonenb wrote:
since im new , please give me full answers including what controls do i need to use and any suggestion, if someone did something similar, an example will be great
no.
Since you're just starting learning MFC ( and maybe programming ), I suggest to learn the basics before doing stuff like that.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
i find your answer rude
i may be new to mfc , but im a software engineer, this is a side project i wanna do
at my free time, and this is what i need, i have read a book about mfc and the basics seems really simple, but i cant find advanced stuff i need.
please give me good answer to the point and not another smart guy with answer similar to the last one, this answers are not helping !!
Gonen
|
|
|
|
|
What you are trying to do is basic thing
MSN Messenger.
prakashnadar@msn.com
|
|
|
|