|
Your program is correct, it is VC++ that is failing here. You can workaround the problem by defining your function in place, if you can afford it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
would anyone be able to point me towards a sample to make a activex ocx/dll that can be used in vb?
shotgun
|
|
|
|
|
I made an IE toolbar but there is just one problem. It works perfectly on my system (Win98) when I compile it. The problem is when someone else tries to install. So far its only been tried on WinXP, not sure if that is the reason. What happens is that they can see the large Toolbar button at the top of IE but not the toolbar. Nothing happens when they click the large toolbar button and the toolbar does not show up under the toolbar menu. Why is this happening??
There is one thing that I changed that my be causing this, the top section of my Toolbar.rgs. I changed both the CLSID's and ForceRemove, could this be the problem? Right now it looks like this:
<br />
HKCR<br />
{<br />
KControl.ControlBar.1 = s 'K-Control'<br />
{<br />
CLSID = s '{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}'<br />
}<br />
KControl.ControlBar = s 'K-Control'<br />
{<br />
CLSID = s '{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}'<br />
CurVer = s 'KControl.ControlBar.1'<br />
}<br />
NoRemove CLSID<br />
{<br />
ForceRemove {E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16} = s 'K-Control'<br />
{<br />
ProgID = s 'KControl.ControlBar.1'<br />
VersionIndependentProgID = s 'KControl.ControlBar'<br />
ForceRemove 'Programmable'<br />
InprocServer32 = s '%MODULE%'<br />
{<br />
val ThreadingModel = s 'Apartment'<br />
}<br />
'TypeLib' = s '{BA246564-5224-4427-9595-CC18617AF491}'<br />
}<br />
}<br />
}<br />
If that is the problem than how can I fix it?? Please help, Thanks.
|
|
|
|
|
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
|
|
|
|