|
It's working !! Thanx
|
|
|
|
|
How can I declare function pointer to be put into a map ??
like:
std::map
|
|
|
|
|
This should work:
typedef bool func(long, CDataBase*);
std::map<long, func*> mapLongToFunc; Though i suppose there's prolly a more concise way of doing it.
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
Your syntax is a little off, it should be:
typedef bool (*func)(long, CDataBase*);
std::map<long, func> mapLongToFunc;
--Mike--
Actual sign at the laundromat I go to: "No tinting or dying"
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Thank you. I stand corrected
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
Are there any tools can generate header file from a cpp file automatically?
For example it generate the cpp file:
double sum(double a, double b)
{return a + b;}
bool islowercase(char ch)
{return ('a' <= ch && 'z' >= ch);}
void main()
{printf("A");}
into a header file as:
double sum(double, double);
bool islowercase(char);
|
|
|
|
|
it really wouldnt be so difficult to process the file and figure out the function def lines and write them to a header file
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
ivex wrote:
Are there any tools can generate header file from a cpp file automatically?
Not that i've heard, although i'd love to see one. This is something that really grates on me when reading or writing C++ after seeing Java or C# code.
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
yer there is
a perl script called "makeh"
Bryce
|
|
|
|
|
If you're using VC6, I think you haven't studied the compiler switches before asking. But then "void main" also displays something. :->
Try /Zg
|
|
|
|
|
How can i replace the standart window class name for dialog window, given by MFC (#32770) with my one?
|
|
|
|
|
That is the standard name of the dialog class given by windows.
All that you have to do is subclass the dialog with SetWindowLong.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
First of all, unless you want to change some specific behavior for all dialogs, why would you want to do that?
I don't quite remember (long time since I did this) but you have to register a new class, with a new window procedure (which pases unhandled messages to DefDlgProc instead of DefWindowProc), and a cbWndExtra value of DLGWINDOWEXTRA (30 bytes last time I checked.)
Also you must add a CLASS statement to the dialog box template in the RC file.
Then you can use CreateDialog or DialogBox to display the dialog.
(Ok, everything here was SDK instructions, but not difficult to translate to MFC)
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
CPUA: 0xC0DE - No Sonork yet
MiniPutt best: 20
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
I want to do that because there is a requirement an other program to take a handle to my window. This is done with FindWindow function. The inconvenience is, that there may be an other dialog windows, and FindWindow find out one of them. I need my window class to be unique.
I solved the problem. I have not written a new dialog procedure, only obtain a class info with GetClassInfo function for #32770 and replace the name with my own. Then i registered the new class, and added a CLASS statement into .rc-file. Thank you!
|
|
|
|
|
Hi,
I'm using Visual Studio .Net for my project. When I create the exe and run it on a 2K system. It tells me I am missing msvcrt70.dll. After debugging it, I found that it happens when I call LoadLibrary. My question is why does LoadLibrary depend on this file and is there a way to remove the dependancy?
-Thanks
|
|
|
|
|
No, you simply need this file as your program uses some of its functions. You have to distribute it along with your program, the other solution is to write application without use of MFC (i am not familiar with .net, so i dont know if that is possible (it should be)), but i guess you dont want that either .
|
|
|
|
|
I'm not using MFC. Anyway, I figured out why it was dependant on it and was able to remove the dependancy.
Thanks
|
|
|
|
|
Hi!Tell me,please,how can I put Wallpaper(background)in to the view of my project and what type of file it must be (.bmp or ...)
Thank you very much!
|
|
|
|
|
You have to handle WM_ERASEBKGND .
Irina.T wrote:
what type of file it must be (.bmp or ...)
I don't think there is limitation for it.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Handle the WM_ERASEBKGND message sent the view.
the wParam will contain an HDC if you are programming with the SDK, or the OnEraseBkGnd function will have an HDC that you should use to paint on.
You will be able to use any format that you can find or write code to load into an HBITMAP object. Try searching this site, there are a number of utilities to help with image loading.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
suppose i begin two threads in my process by _beginthread(),now i wanna terminate one thread from another,how shall i?(i dont wanna use MFC)
thanks
It's a good day today
|
|
|
|
|
How are you synchronizing between your two threads?
I would create an event and have the second thread periodically check for that event to be set, then terminate itself with a call to _endthread .
Or if you have a MessagePump, you could also send a message to that thread informing it that it should shut down. In order to send a message to another thread you need to use PostThreadMessage .
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks.
In fact i am writting for my homework--transfer files by TFTP protocol.The two threads,one is used to receive data packet,the other serves as a timer.If the first thread has been waiting for too long a time,the 2nd shall timeout and abort the first one.So will event still work in this case?Because before data packet arrives,the first one just stop there,waiting;so it perhaps can not periodically check messages.
The other problem is that i write my program in C,but i notice that PostThreadMessage is a method of a class CWinThread.Are there other ways?
God blessing me...
|
|
|
|
|
Look again at your documentation: there's a C only version of PostThreadMessage (the MFC is merely a wrapper around this.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi.
I have a dialog box. When Windows draws the dialog box, I want to to focus to a specific CEdit object (window). For example, let say the dialog box asks the user for a username and password. I would like Windows to focus the username window when it first draws the dialog box.
What is the best way to do that?
Thanks,
Kuphryn
|
|
|
|