|
Use a picture control and set its type to Rectangle, then adjust it to the size you need. Default color is black but it also supports white and gray. If you need the thickness smaller than 5 dialog units, temporarily set your layout grid height to a smaller value.
|
|
|
|
|
Hello,
I want my program able to burn a CD/DVD. Could you give me a bit of idea how to support cd burning in my application? Do you know any good quality cd burning library?
Thanks!
|
|
|
|
|
If your program will only run in Windows XP, you can use the IMAPI API. If you need other platforms, you'll need some 3rd party products and APIs.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Download NEROs Burning SDK. I don't know the URL but go to NEROs website and search there!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
Using VC7
I'm very new to MFC, but I know the general workings of the language pretty well
OK, so the little wizard made me a nice app... right... but now I want to edit that nice little thing...
1) How do I stop that one new decument from popping up at start?
2) void CIceBuilderView::OnDraw(CDC* /*pDC*/)
Why is the pDC commented out by default?
3) How can I make the client window use scrollbars? Currently child windows can get missing out of the client window area...
|
|
|
|
|
Locked Ghost wrote:
1) How do I stop that one new decument from popping up at start?
Override CWinApp:OnFileNew()
Locked Ghost wrote:
2) void CIceBuilderView::OnDraw(CDC* /*pDC*/)
Why is the pDC commented out by default?
You are probably talking about a header file. In headers, definitions do not need param names. Param type is enough for the compiler. Remember a header file is NEVER mandatory, just a nice way to program.
Locked Ghost wrote:
3) How can I make the client window use scrollbars? Currently child windows can get missing out of the client window area...
A typical app uses a CScrollView document/view model, hence scrollbars are automatically managed.
I recommend you read "Windows programming with MFC", MSPRESS, Charles Petzold.
Back to real work : D-27.
|
|
|
|
|
Thanks, that helped.
I have a few more questions:
How can I create a window that stays on top of the other child windows like a floating toolbar?
How can I then tell that window to update itself? (I want it to update when the current view is changed. I think I can figure out how to see if it's changed)
How can I load the contents of a BMP file from memory, into a... CPicture, was it? and then how can I draw a (square) part of that to the view with a transparent colour? And without a transparent colour(Parts of the BMP are opague, but not all)?
|
|
|
|
|
Locked Ghost wrote:
How can I create a window that stays on top of the other child windows like a floating toolbar?
I won't show you how to do this. That's an annoying habit.
Locked Ghost wrote:
How can I then tell that window to update itself? (I want it to update when the current view is changed. I think I can figure out how to see if it's changed)
Windows (whether CView or not) update themselves already. If you want to force an update, you've got to call CDocument::UpdateAllViews(...).
Locked Ghost wrote:
How can I load the contents of a BMP file from memory, into a... CPicture, was it? and then how can I draw a (square) part of that to the view with a transparent colour? And without a transparent colour(Parts of the BMP are opague, but not all)?
CMemDC is probably the keyword you should use to find something relevant on CodeProject about that.
Handling transparent colors can be achieved in many ways. One I usually take is by creating a CImageList since this class allows to set a key color to a bitmap.
Back to real work : D-27.
|
|
|
|
|
Thanks
.S.Rod. wrote:
Locked Ghost wrote:
How can I create a window that stays on top of the other child windows like a floating toolbar?
I won't show you how to do this. That's an annoying habit.
Why is that?
|
|
|
|
|
People ask this question three times a week
There are many articles here on CP how to describe it. You might want to take a look at "Dialog box tricks" by Nishant S
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Locked Ghost wrote:
Why is that?
A window should come on top only if explicitely asked by the user. Otherwise, it's like a annoying popup on the web : it may interrupt you while you were entering text somewhere, or clicking somewhere.
That's basic UI guidelines. I don't think further explanations are required.
Back to real work : D-27.
|
|
|
|
|
|
You will be my best friend if you can help me on this one
line of code for error 2440:
CString str_somedata;
TCHAR Data[] = str_somedata;
then I tried
TCHAR Data[] = str_somedata.GetBuffer(0);
results in cannot convert from 'char *' to 'char [] error
Please Help Me?? I have been wasting at least 2 hours
|
|
|
|
|
try TCHAR * instead of TCHAR []
-c
“losinger is a colorizing text edit control”
-- googlism
|
|
|
|
|
I still get same errors.
The reason why I need to convert is that TCHAR Data[] gets past to a function, that would be a hasle to change
|
|
|
|
|
I take that back, it works with
TCHAR* Data= str_somedata.GetBuffer(0);
Thanks!!!
|
|
|
|
|
Two problems. One, you can't declare a TCHAR[] on the stack unless it is initialized with a string literal, such as:
TCHAR szBob[] = _T("hello!"); Two, you are trying to put a CString into a character array. A CString is a wrapper class that manages its own character buffer. You can do this:
TCHAR* psz = str_somedata.GetBuffer(0); as long as you understand what that means - you're temporarily getting control over the character buffer.
Please see my two articles on the string wrapper classes, where I cover all these details.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
TCHAR* psz = str_somedata.GetBuffer(0);
Perfect!!
|
|
|
|
|
Michael Dunn wrote:
Please see my two articles on the string wrapper classes, where I cover all these details
This is what you should have said in the first place.
Frankly, I believe Chris should show a spanking and blinking STRING CONVERSION article link in the "new message" form. This would avoid many posts...;P
Back to real work : D-27.
|
|
|
|
|
Hi,
Using MFC DLL, no enter point such as "WinMain" in Win32 DLL, I find it's difficult to begin a thread at the beginning of MFC DLL and terminate the thread before Termination of DLL. Because of using a lot of MFC class, I have to use MFC DLL, but I also have to use a thread at the beginning of DLL and terminate it just before the end of DLL. Tell me how to deal with this dellima.
Thanks in advance.
Extreme programming. Do the No.1
|
|
|
|
|
The entry point for DLLs is, by default DllMain, unless you specify otherwise in the linker settings.
In your DLL Main you're handling a DWORD reason code for something calling DllMain. Depending on what you're doing, you may want to start your threads when a process attaches, or more safely, when a thread attaches; and end it when the thread or process unloads the DLL (See DllMain[^]):
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpvIgored)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
default:
return FALSE;
}
return TRUE;
}
Please note, that if you fail to create your thread, you should probably return FALSE, and not break out of the switch . Also, calling TerminateProcess or TerminateThread may not be a good idea since it won't do it gracefully. You'll be safer setting a flag for your thread to terminate (such as a boolean bStillRunning = false.) If you need to do work after the thread finishes, you should probably use WaitForSingleObject with an event handle which is "set" by your created thread when it exits:
while()
{
}
SetEvent();
return 0;
Take a look at Using Event Objects[^] on MSDN.
You will have to keep a "list" of event handles, and WaitForSingleObject on the thread event handle in question. You can't just create one handle for signalling the exit of your thread because you may have multiple threads exiting and not know which one was the one you were concerned with.
When you create the thread, you can pass the specific event handle you create for the thread to your "worker" thread through the parameters part of whatever you're using to create the thread (e.g., AfxBeginThread() )
|
|
|
|
|
A regular MFC DLL has a CWinApp object, so you use its InitInstance() and ExitInstance() functions to do your init and cleanup tasks.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Oh yeah, oops, I'm stuck in Win32 somewhere, I haven't used MFC for DLLs in over two and a half years
|
|
|
|
|
Hi,
There should be a main function, and in it's space can i use theApp object as well as it's member functions. My problem is, there is only a theApp object and nothing else.
If I use Message queue in this thread, WaitForSingleObject will be used to wait for the end of thread in the main function.
No main function, where can I write this code for wait for the termination of this thread?
thanks
Extreme programming. Do the No.1
|
|
|
|