|
try VC Main Menu->Project->Add to Project->Components and Controls
Press it and select Visual C++ components, then you can see dialog bar.
|
|
|
|
|
yes ,but u don't explain how i configure to use it???
|
|
|
|
|
Search on MSDN for TN031. It is a technical article about Control Bars, which is the base of a CDialogBar.
~RaGE();
|
|
|
|
|
It's really simple to add a dialogbar.
first,
Create a Dialog template into the resource editor. Name it IDD_MYDLGBAR or whatever name you want to give to it.
second,
Into your parent windows class (probably your mainframe class),
in MyMainframe.h
CDialogBar mydlgbar;
into MymainFrame.cpp
if(!mydlgbar.Create(this, IDD_MYDLGBAR, CBRS_RIGHT, IDD_MYDLGBAR))
{
return 0; // fail to create
}
where:
first parameter = parent handler
second parameter = id of the dlg template
third parameter = position of the dlgbar CBRS_RIGHT, CBRS_LEFT, CBRS_BOTTOM, CBRS_TOP
last parameter = id of the dlg template
MemLeak
Everything's beautiful if you look at it long enough...
|
|
|
|
|
i thank you MemLeak it work well .
|
|
|
|
|
i want to add in this new DIALOGBAR one Slider and EditBox who show the progression of the Slider,but i have problem because i think that they have two DIALOGBAR in the application the first with the MFC application when it's created and the second who it's the child and i creat it .
|
|
|
|
|
Hi,
For your question with opengl, you can find a lot of stuff out there (web) to help you. Also, you can have some example here on code project. If you want more specific examples of how to use opengl with mfc you can go here:
http://pws.prserv.net/mfcogl/
hope it help you.
Everything's beautiful if you look at it long enough...
|
|
|
|
|
I am trying to have my app monitor the every key stroke. If F6 is press at any time, it should launch? Can anyone guide where I can find out how to do this?
Thank you,
SAK
|
|
|
|
|
If you want your app to be activated when a key is pressed, take a look at the RegisterHotkey[^] function, and its message friend, WM_HOTKEY[^]. You can use the RegisterHotkey function to register a hotkey that, when pressed, sends your window a WM_HOTKEY message. You can then activate your app when you get it.
BTW, F6 is not necessarily a good choice of hotkey, because another app is likely to already be using that key combination as a shortcut. Maybe you should use Ctrl+Shift+F6?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Thank you so much for the help..most appreciated.
|
|
|
|
|
In a winform program,I use findwindows and sendmessage to close another winform application successfully,
but when I use it the same way in a console exe in a windows service,it doesn't work!!!
why and how????
lost my way
|
|
|
|
|
That is because the window you are looking for is not on the same desktop as the service. You need to impersonate a user. You might be able to have your service login as a user, but you may just get another desktop.
This gets into a very deep topic of Win Stations and desktops.
|
|
|
|
|
thank you whatever.
So maybe I must use other method to control a win application from a service,Name pipe or tcp connect may be easier for that.
In addition, I create the winform process from that service, but I cann't get the same process ID from findwindows.It seems there are too many limitations in windows service programing.
lost my way
|
|
|
|
|
when I use your CScrollCtrl on a dialog bar, there is something error when switching show/hide the dialog bar, I have made a test, but I don't know how to post it, I really hope shog9 can help me to deal with this problem, when you hide the dialog bar and show it again, there will pop up a error message about assert failure in wincore.cpp line 628. I want to mail the test source code to you, but I don't know how to contact with you
swandream
|
|
|
|
|
I make a windows service with ATL,and when I want to open a database in the service work thread(I creat a new thread), it doesn't work??? And when start the service in SCM, a error show: debug error ??? I don't know why?
Please help me , and if you have one sample ,give me one?
and my code below:
//if( !m_db.Open( _T("SmsSendBuff"),FALSE,TRUE,_T("ODBC;UID=saWD=") ) )
//these two open operation doesn't work both!!!
//if(!m_db.OpenEx("DSN=SmsSendBuff;UID=saWD=",CDatabase::noOdbcDialog);
_ConnectionPtr Conn1("ADODB.Connection") ;
HRESULT hr=Conn1.CreateInstance( __uuidof( Connection ) );
_bstr_t bsDSN = (L"SmsSendBuff");
_bstr_t bsEmpty = L"";
Conn1->ConnectionString = bsDSN;
//hr = Conn1->Open("dsn=SmsSendBuff;uid=sa;pwd=;","","",0);
AfxMessageBox("open...db");
hr=Conn1->Open(bsDSN,_bstr_t("sa"),_bstr_t(""),-1);/*bsEmpty, bsEmpty, bsEmpty, -1 );*/
my email and msn: diyzhaodiyzhao@hotmail.com
I'll be appreciated if getting your help!Thank you!
|
|
|
|
|
Did you call CoInitialize() in the work thread before you create the COM instance? CoInitialize() (or CoInitializeEx()) has to be called on every new thread...
|
|
|
|
|
I ran into this once -- and for my case it had to do with where I installed the ODBC DSN -- when running as a console application, it was OK to have the DSN be registered as a "User DSN".
But as a service, it needed to be registered as a "System DSN"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
to:Peter Weyzen
I had the DSN be registered as a "User DSN",the code did't work, and now it is registered as "System DSN",the code works.
but I don't known why must I create the DSN as "System DSN"?
Thank you for your help,and thanks to Wout Louwers, thank you!
|
|
|
|
|
I've not investigated the "why" -- but if I were to guess, I'd assume that it all depends on how the service is installed.
I assume it's a security issue:
If the service is bound to a user -- like you -- then it would use your User-DSN. But if your service is not bound to a user, but to "LocalSystem", then your User-DSN's are not available...
That's just my guess, but it makes good sense.
-p
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
to:Peter Weyzen
you said:
"That's just your guess, but it makes good sense."
YES, I think with this entirely.
Thank you for your help, thank you.
|
|
|
|
|
Does anyone know how to get the first frame of an compressed AVI?
Using the AVI-APIs the AVIStreamGetFrameOpen is returning a NULL when the video stream is compressed. Works fine for non compressed videos.
I also tried the suggestion from Jung Jinhyuck ( http://www.codeproject.com/audio/avitowmv.asp ) which looked very promising.
Looks like the decompression is not done, but the same compressed AVI can be viewed with the Media player on the same machine. Thought the AVI-API could access the same decompressors.
(Using WinXP and VC .NET)
Thanks
Jürgen
|
|
|
|
|
Use DirectShow, which is probably total overkill for one frame.
You can make sure that the correct decompressors are in the graph using GraphEdit, I think an older version of DirectX (7 or 8?) may have even had a sample program for grabbing a single frame.
|
|
|
|
|
Thanks for your suggestion.
I just wanted to give the icons in my listview a small preview of the AVI files from my camera
Wouldn't introducing DirectShow to an app make a dependency on the DirectShow components installed on the system?
For example I use the latest version of DirectShow but the system has an older version installed?
Thanks
Jürgen
|
|
|
|
|
Dear Everybody,
I am facing problem putting a trasperent Bitmap(i. a logo) on running video screen. I am using Win 32 API.
I will put the problem in detail. The bitmap is a logo and has 2 colors white over black background. I need to show only the white part of the .bmp on the video widow and the black portion of the bitmap should show the background video.
Does anybody have a solution... Please reply soon.
Regards,
Abhi
|
|
|
|
|
I can only sujest you look at using regions: SetWindowRgn(). You might try seaching codeproject for the article on using regions with vector graphics: it shows how to place a region around a vector graphics image so that the image it self is the window.
Trust in the code Luke. Yea right!
|
|
|
|