|
hi,
check for the old CLSID i guess you have not changed it everywhere..and other things which you ahve changed..also add the forceremove thing....and check hope it works fine for you..
cheers
Himanshu
|
|
|
|
|
I wrote a function to subclass a normal button (add bitmap, change backcolor...)
So when I push this button slowly >> it works okay
but when I push it quickly >> its interface is disorderly
I process wrong a message from button's window proc
help.......thanks
MyProject
Skid Row
|
|
|
|
|
You have to handle the WM_LBUTTONDBLCLK message
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!
|
|
|
|
|
Thank you for that
thank you again
|
|
|
|
|
I have a function that takes a std::string
void SomeFunc(string str);
I want to use std::string (instead of CString) because this function is complied for both Unix and Windows
Then in a MFC dialog program, I set a edit control to a CString. What is the best way to convert CString to std::string? Can I associate std::string insteaf of CString with an edit control?
Thanks in advance.
|
|
|
|
|
tomc wrote:
What is the best way to convert CString to std::string?
myStdString = myCString;
tomc wrote:
Can I associate std::string insteaf of CString with an edit control?
you can write a new DDX function to grab the text from the edit control into a std::string. look in dlgdata.cpp (part of the MFC source) and see how the standard DDX function work. it should be pretty easy to write one that takes a std::string.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
|
Using VC6:
I'm trying to link an OBJ file into my MFC C++ application. If I include the obj file in the linker input settings, I get duplicate definitions for functions in libcmtd and nafxcwd. If I set the linker input options to ignore the nafxcwd library results in all kinds of unresolved external errors.
If I do this...
#pragma comment( lib, "papytelemapp.obj")
...I get this
warning LNK4003: invalid library format; library ignored
I do NOT have the source code for the obj file and MSDN doesn't say ANYTHING about this that is more descriptive than what the compiler spits out. I am fairly certain that the obj file is compiled with VC++ 6.0, and the struct byte alignment is set to 1 in the OBJ file (my program is set to 8).
Things I've tried:
1) Changing the linker output to "both" COFF and Microsoft debug formats
2) Changing my program's struct alignment to 1 byte
Anyone got a hint for me?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
If I include the obj file in the linker input settings, I get duplicate definitions for functions in libcmtd and nafxcwd.
my guess is that your project is using different c-runtime settings than the .obj, so the .obj is looking for things in one runtime set but your app is setup to use another.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
One of the guys here at work suggested that I add the OBJ file to the project using the Project|Add To Project|Files, and seeing if that doesn't fix it.
I'll be giving it a shot when I get home from work.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
And that indeed solved the problem. I get a warning about libcmt, but so what...
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Can I get a HWND to the listbox part of a combobox? 7 ComboBoxEx?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi All
I am getting the below errors and could not found any reason. I a mtrying to do a simple screen saver with (unmanaged) c++ by using scrnsave.lib
ScreenSaver error LNK2019: unresolved external symbol _DefScreenSaverProc@16 referenced in function _ScreenSaverProc@16
ScreenSaver error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
ScreenSaver fatal error LNK1120: 2 unresolved externals
What could be the reason
karanba
|
|
|
|
|
I'd like to know what is the benefit that i get when i enable the socket keep-alive mechanism?
I know that it is transpanert to the application layer.
Now, suppose i use MFC socket whereupon i get OnClose event in case the client or the server is down.
Therefore, i don't undestand when shall i enable the keep-alive mechanism and what is the benefit??
Thanks,
Dudi
|
|
|
|
|
Almost never, keep alive default notify ~2 hours....
|
|
|
|
|
Yes i know that. However, what is the benefit when keep-alive is enabled?
|
|
|
|
|
What shall I do in order to slow down the implementation of OnEndSession() (or OnQueryEndSession) - I mean when the program or the system sends WM_QUERYENDSESSION (or WM_ENDSESSION) a dialog appears - I need 10-15 seconds for the user to read the message on this dialog and then continue with the implementation of OnQueryEndSession() and OnEndSession() functions.
I tried with a timer but something went wrong. Is there another way?
|
|
|
|
|
Hi, everyone!
I have often noticed that someone declares a friend
fucntion inside a class (in the .h file of the class)
and give the definition of the function in the .cpp file
of the same class. I want to know whether this
method is correct? Does it have some weak points? Where should
correct place which we give the definition (Note: not the declaration)
of the function?
Another question is, if I define the function like below, what is the
scope of the function? (i.e. where can compiler find the function?)
Here is the sample codes I noticed:
in A.h
--------
class A {
friend int functionA();
void memberfunction();
}
--------
A.cpp
--------
A::memberfunction()
{
//implemention
}
int functionA()
{
//implemention
}
--------
Thanks in advance,
George
|
|
|
|
|
Hello guys,
I am looking for a function that is similiar to MessageBox function, however, would have ability to include formatted variable in the pop-up windows box.
Best way to illustrate, is something in combination of printf and MessageBox
int number = 3;
printf("Number is : %d", number);
so, might mean doing that in forms of MessageBox
MessageBox("Number is : %d", number);
Is there funtion MFC that could server that purpose?
Thanks in advance for any help.
|
|
|
|
|
CString myMessage;
myMessage.Format("Number is : %d", number);
MessageBox(myMessage, ..., MB_OK);
Brian
|
|
|
|
|
There isn't an MFC function for this. I use code like the following in ED (see sig) for it's "Do not ask again" message boxs.
MsgBox( TCHAR* pStr, ... )
{
va_list marker;
va_start( marker, pStr );
const int nMaxMsgSize = 10 * 1024;
TCHAR substmsg[ nMaxMsgSize+1 ] = {0};
_vsnprintf( substmsg, nMaxMsgSize, pStr, marker );
MessageBox( hWnd, substmsg, Caption, uType );
va_end( marker );
}
You need to fill in the missing bits like hWnd etc,
Hope that helps.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hello,
The solution is to first format your string, then display the message box. The best way is probably to use a varlist and to implement your own function. Here is my own:
int AfxMessageBoxFormat (LPCTSTR lpszFormat, ...)<br />
{<br />
<br />
CString s;<br />
<br />
va_list args;<br />
va_start (args, lpszFormat);<br />
<br />
s.FormatV (lpszFormat, args);<br />
<br />
va_end (args);<br />
<br />
<br />
return AfxMessageBox (s);<br />
}
Hope that helps,
JM
Web: http://goa.ifrance.com
|
|
|
|
|
I don't think there is, but I'm working on just such a thing in C#.
"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
|
|
|
|
|
Hi, everyone!
Suppose I have a customer class defines a customer
time presentation structure. It has three int member
variables: year, month and day.
I have noticed someone who overloading time_t operator.
But I do not know how to do it, one of which can be reached
at,
--------
http://www.p2ptoolkit.com/classl2t_1_1base_1_1Date.html#a7
--------
Can anyone tell me how to overload time_t operator? Another
question is I do not know how to use a overloaded time_t
operator.
Here is the code I write myself. I do not know whether it is
correct. I still do not know how to use a overloaded time_t
operator of my class. I just write the operator overload function
from my thought that maybe it should be like this.
Can anyone help?
--------
Class MyTime {
int year;
int month;
int day;
MyTime::operator time_t() const
{
struct tm wn = {0};
wn.tm_mday = day;
wn.tm_mon = month;
wn.tm_year = year;
time_t output = mktime(&wn);
return output;
}
}
--------
Thanks in advance,
|
|
|
|
|
time_t isn't an operator, so you can't overload it. It's a standard C typedef for representing time. I guess what you really want is a type conversion operator between MyTime and time_t ? That overloads the operator () . Your code is correct for overloading the () operator, but don't use MyTime:: prefix when the function definition is inside the class, and the variable output is redundant.
|
|
|
|