|
How can I pass arguments to CDialog allowing me to update a CListCtrl?
ie OnDblClick/etc, I call a modal CDialog for editing purposes, however I cannot pass arguments (ie ListItem contents to change).
Basic question - guess I am basically lost
|
|
|
|
|
You could pass the address of the list control to the dialog just before you call the dialog's DoModal() . For example:
void OnDblClick()
{
CMyDialog dlg (this);
dlg.m_pListCtrl = &listCtrl;
dlg.DoModal();
}
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
How do I convert this type.
I'm importing the CDOSYS lib, and I need to call the
pFld->put_Value(_variant_t(myconvertedtype));
the Microsoft examples use static "myaddress@something.com" , and I've not done stuff with this before.
Thanks for your help.
|
|
|
|
|
CComVariant varMe("this is long ascii"String");
pFld->put_Value(varMe);
|
|
|
|
|
Sorry the proper answer is:
_variant_t vtTemp;
char* szTemp;
...
...
szTemp= (char*)malloc(100);
strcpy(szTemp,"hello there");
vtTemp.SetString(szTemp);
pFld->put_Value(vtTemp);
free(szTemp);
|
|
|
|
|
Hi,
The following compiles fine under gcc, but generates a compile error on line 2 in VC 7.0.9466 (error C2988: unrecognizable template declaration/definition)
template<class t,class="" alloc="">
template<class t1=""> // <------ error
CDSVectorBase<t,alloc>&
CDSVectorBase<t,alloc>::operator*=(const T1 &x)
{
...
Is this a problem with the C++ compiler, or is the code not ANSI compliant?
Thanks.
|
|
|
|
|
Can you please modify your post (or repost) using < and > for the angle brackets, otherwise codeproject thinks they are HTML tags and so does not display them.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
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....
|
|
|
|