|
|
But all the CDialog constructors have either 2 or zero number of arguments.....?
CDialog::CDialog in mSDN ..???
I'll try your idea but just wondering about the 1 argument constructor you have...
Appreciate your help,
ns
|
|
|
|
|
Nish is talking about the CDialog-derived class that the ClassWizard creates for you when you associate a dialog resource to a class. That one only has one parameter and it's the parent window.
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
Thanks. If I may....where did you find this info? Next time I'll search that resource for help as well....
I just looked in the mSDN under CDialog
Appreciate your help,
ns
|
|
|
|
|
Have you ever used the Class Wizard to generate the CDialog-derived class for your dialog box template??? I suspect you haven't. If you had, you'd have seen the constructor for the class that gets generated.
I recommend you take an online tutorial to given you a broader view on all the techniques you can use to generate MFC code. The one that really helped me (a long time ago) was the "Scribble" tutorial. It taught me all about using the Class Wizard for dialog boxes. Believe me, it's a must-know!
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
oh! I see the constructor. I actually do use the CW to create my CDlg derived classes, but when i make a new object I didnt think ( ) of looking at the .h file. Instead I went looking for the CDialog docs...
But thanks I shall look at scribble.
Appreciate your help,
ns
|
|
|
|
|
I have a program that when compiled must remain the same. I am using preprocessor directive to make some significant changes to the program. Where I have been stumped is in the icon changes. I have managed to get all the icons within the application changed and the one's on the toolbar and all.
I am having to force the changes to the taskbar icon and Alt-Tab at compile time manually because I cannot figure out how to change them. I have not figured out how to change the icon on the right click properties menu on the application from explorer.
Basically I have 2 programs in one project. Each with seperate icons and program names. I have not been able to figure out how to change the icons in the second program at compile time.
Can anyone help?
|
|
|
|
|
|
Is there any programmer that wrote any program for Advantech DAC (PCL810HD series)?
Please help me!!!
A. Riazi
|
|
|
|
|
good day!
still trying to custom paint CEdit borders, it's working more or less ok now, but I'm having problems with coordinates (rect) of my control, and where I paint.
This is what I do now, it does work when the CCustomEdit is in a dialog without any border, my main "target", but now I have to use this in other dialogs, and the clientRect is wrong, the conversion is not good, and does not take into account the dialog borders (caption, borders, ... ).
What is the proper sequences to get the CEdit rect ( in the dialogs coordinate ) and Inflate it to fit the CCustomEdit rect ?
The target look is to have the border around the CEdit.
void CCustomEdit::OnNcPaint() <br />
{<br />
CDC* pDC = GetParent()->GetWindowDC();<br />
<br />
CRect windowRect;<br />
GetWindowRect( windowRect );<br />
<br />
CRect clientRect;<br />
GetClientRect( clientRect );<br />
<br />
ClientToScreen( clientRect );<br />
GetParent()->ScreenToClient( clientRect );<br />
<br />
clientRect.InflateRect( 2, 2, 2, 2 );<br />
pDC->FrameRect( clientRect, &m_BorderBrushFocus );<br />
<br />
ReleaseDC(pDC);<br />
<br />
}
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I emailed you a little demo app that shows how to do this using OnNCPaint() , OnNCCalcSize() , and PreSubclassWindow() .
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
hey guys, I am trying to get an idea of how I can write functions in C++ which can be used by visual basic 6 programmers.. anyone have any suggestions on where to get started? i have seen how dlls work looking at the introduction to com article, but that dll doesnt seem to work in vb, keeps giving me 'can't fint dll entry point' errors..
im also considering switching to c#, is it easier to write dlls in c# that to learn how to in c++?
if i could just have one example that would work in vb that would help so much.. anyone got any links?
thanks a bunch!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
See if this helps
in some .h file
long __stdcall GetAccountCodeFromAccountNumber(char*, long);
in your .cpp file
long __stdcall GetAccountCodeFromAccountNumber(char* caAccountNumber, long nCharacterCount)
{
long nReturnValue = 0;
.. do what ever you want kinda stuff.
return nReturnValue;
}
what's needed in the VB program
Public Declare Function GetAccountCodeFromAccountNumber Lib "TradeInput.DLL" ( ByRef AccountNumber as String, ByVal AccountNumberLength as Long ) as Long
Dim AccountNumber as String = "123456";
Dim AccountNumberLength as Long = 6;
Dim AccountCode as Long = GetAccountCodeFromAccountNumber(AccountNumber,AccountNumberLength);
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
i tried what you have here, but unfortunately im still getting my Run-time error 453 - Can't find DLL entry point GetAccountCodeFromAccountNumber ...
i tried what goes in the .cpp file both with and without the class name preceding the GetAccountCoddeFromAccountNumber(char*... but it didnt make a difference.. im going to try to create a new project (instead of using the one in the introduction to com example) .. what type of project should i select? MFC DLL im assuming.. ill let you know if that does anything for me..
thanks for the example!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Sorry, I did that too quickly. You also need to export the function.
in the .def file
EXPORTS
...
GetAccountCodeFromAccountNumber @99
...
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
You are the man Chris Meech! Thanks fer helpin me out!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hello all!!
I will open a simple text file in MDI or SDI Project.
can somebody help me how i do this.
THX.
|
|
|
|
|
All you need to do is create a SDI or MDI of type CEditView... Then click the open button or from the menu and point it to a text file..
|
|
|
|
|
THX for your fast answer RobJones!!
|
|
|
|
|
Hi there everyone,
I will be very grateful to get any clue/direction about a problem, which I have on the last couple of days:
How can I transfer a rough audio buffer to an audio streaming, I have looked at the sample of this subject in the MSDN and I saw a sample which works properly only with WAV file – I want to check it with a buffer.
Thanks and Regards,
Eyal
|
|
|
|
|
Hello,
it's obvious that I don't free some memory that it's getting occupied again and again till everything blowns up...
The fact is that I've searched for all the "new"s in my project and all of them have their respective deletes...
Is there any way to detect what is happening and where?
would the memory be occupied also by SelectObject if I wouldn't delete the returned pointer?
NOTE:
is important to solve the problem becaus the VC++ program is intended to control a mechanical machine that will work 24 hours a day 365 days per year...
Thank you in advance.
|
|
|
|
|
I'd reccomend you get hold of BoundsChecker - that's a great app for tracking down memory leaks
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
another cause can be your serialization..
if you are reading in during serialization and have any 'new' keywords you could get a memory leak if your loading serialization is called multiple times without deleting what was created the previous time the data was serialized.. i know that was my problem once..
if not then i dunno try searchin for 'delete' in this board and you will come accross a bunch of ppl who have had memory leaks.. including me
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
|
You might want to check out MemWatcher[^].
It's not a developer's tool, but it can help keep your PC running smoothly over long periods of time by freeing up memory that Windows thinks is in use. It works especially well on Win9X and ME which frequently "runs out of memory" when it shouldn't.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|