|
George2 wrote:
When you say inline function
Something like :-
class Abc()
{
void Hello()
{
}
};
Hello is defined directly here as you can see. If you were using separate CPP and H files you'd have put just the declration in the H file and the definition would have been in the CPP file
George2 wrote:
Can you show me an example?
Well the main CPP file for an MC++ project need not have a H file. You juyst put all your classes into this main CPP file. And similarly any other classes might be fully defined in a H file (this time no separate CPP files)
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thanks, Nishant buddy!
George
|
|
|
|
|
Hi, everyone!
I have heard that type conversion operator will
produce ambiguity when the compiler is implicitly
converting your types for you when the error will
occur "there are two or more functions that match..."
But I have not found an example code. I just heard that
but have never met with the very case.
Can you show me one example of that?
regards,
George
|
|
|
|
|
Here's a really rough example
void f(int n) { }
void f(char* p) { }
class C
{
public:
operator int() { return 1; }
operator char*() { return "hi!"; }
};
main()
{
C obj;
f(obj);
}
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Thanks, Michael buddy!
George
|
|
|
|
|
Does there exist on sourceforge or similar a set of classes for an OOP interface and implementation for using FTP and P2P...?
I much prefer working with objects rather than c api's.
I would like them to be as platform independant as possible also, so MFC's classes won't cut it.
Thanks in advance.
BTW - I want open source (free would be prefered)
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
My MFC7 app needs to be able to create a resource dll and add resources (string and html) to it on-the-fly. How would I go about doing that? I've looked around in MSDN and using Google, but I haven't found any information on doing that yet.
|
|
|
|
|
|
I agree with you, but unfortunately the programmers at Digital Anvil didn't think so when they made Freelancer Freelancer stores all the text information in a number of resource-only dlls, and I'm the maker of a mod manager program for Freelancer (FLMM). I'm wanting to let mods easily add new string/html resources to a dll for Freelancer to use.
I looked at that documentation, but it seems awfully complicated Do you know if there is any (free) code out there that would do what I want to do?
Thanks
|
|
|
|
|
I'd go the easier route - compile a bare-bones DLL and put that in your app, maybe stick it in as a binary resource. Then when you need to create a new DLL, use that bare-bones one as starting point and use the *UpdateResource() APIs to modify the resources (as long as you can require your users to have some flavor of NT).
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
That is EXACTLY what I was looking for; thanks!
I need to be able to work with Win98 and ME, though, so that might present a problem. I was looking at the MSDN documentation on UpdateResource(), and it said the following at the end:
"Windows 95/98/Me: UpdateResourceW is supported by the Microsoft® Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems."
Does that mean that the unicode version works with 98/ME?
|
|
|
|
|
IGx89 wrote:
Does that mean that the unicode version works with 98/ME?
It might, you'd just have to try it out (or search the net for someone else who's tried it and posted the results)
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
I use an older version of MSLU and it works just fine. The hardest part is getting it setup the first time. But once you get the linking process done properly, everything works great.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Copy empty resource dll and "UpdateResource" it.
It works!
Brian
|
|
|
|
|
I am new to this group so forgive me if I should have looked somewhere else...
In a modal dialog I have a checkbox and an edit fbox. If the checkbox is 'On', the edit field should be enabled. If the checkbox is 'Off', the edit box should be disabled. I have seen this technique in several applications.
Can anyone point me to some code that uses this technique. THe obvious search strings have not turned anything up for me.
Thanks
Tel Monks
|
|
|
|
|
You have to handle the "clicked" event for the checkbox, and then enable/disable the edit box accordingly:
m_Edit.EnableWindow( m_CheckBox.GetCheck() );
There are 10 kinds of people - those that get binary and those that don't.
|
|
|
|
|
You can use the class wizard to automagically generate the message handler Miszuo mentioned above. In the class wizard, select the control, then in the window on the right, select WM_CLICK (i think that's what it is... )
This will map that message to an OnClickYourControl() function. That's where you put the aforementioned code.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Thanks to both.
The remaining problem is that I can't set the EnableWindow when the dialog comes up. That is to say that if the checkbox is not to be "on" (via a Message variable) the EditBox should come up disabled...
See what I mean?
Is there a hook that will allow me to disable the editbox if the checkbox is off?
Tel
|
|
|
|
|
You need to initialize the dialog in the OnInitDialog function, by handling the WM_INITDIALOG message. Add this handler with the class wizard that Nitron was talking about.
There are 10 kinds of people - those that get binary and those that don't.
|
|
|
|
|
Perfect! That took care of the last thing.
Thanks to both of you, my spam detection program is in great shape. If anyone is interested in testing, write to tel@telgo.m
|
|
|
|
|
Glad to be of service!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I launch a modeless dialog that's created with new , and then after the dialog is destroyed, I delete it. Well, all of a sudden, I get debug assertion failures now (i never got them before) note: all in debug mode BTW.
should I not be deleting the dialogs after I destroy them? does CDialog::OnNcDestroy() do this for me?
[edit] No errors in release mode BTW [/edit]
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
You should do a delete this in PostNcDestroy()
void CModelessDlg::PostNcDestroy() <br />
{<br />
delete this;<br />
}
John
|
|
|
|
|
same problem.
Details:
File: dbgheap.c
Line: 1084
Expression: pHead->nBlockUse == nBlockUse
Any ideas?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hmm.....
From that file:
I'll look into it. Thanks for your reply.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|