|
|
I need to add a string resource manaully to the .rc2 file in an MFC project, so did this (copying from the syntax in .rc file):
STRINGTABLE
BEGIN
IDS_THESTRING "really long string here.."
END
and with a define inside resource.h:
#define IDS_THESTRING 101
This compiles but the strings defined in the normal .rc file (that are edited through the string table editor in VS) are no longer valid, any attempt to reference them fails.
Is this the correct syntax for manually adding a string resource?
|
|
|
|
|
This is the correct syntax. You just have to make sure two strings don't have the same ID.
John
|
|
|
|
|
I think in your resource.h there is a counter of different controls. You have to set it up by one. (This very maybe could be your problem.)
the counters are round about the last lines of the file.
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I'm a newbie and have an OCX written in VB (from vendor) which I'd like to use with a VC++ application. Is it possible to use the OCX w/ out a form/dialog, and if so what needs to be done outside of importing it to the project?
Newbie1
|
|
|
|
|
Usualy when i validate data on the OnOK of a CDialog , i can "return", and the OnOK is simply canceled, the dialog remains open.
I whant to make the same thing with a property page:
Needed result:
- Property sheet with multiple pages.
- Validate data on the OnOK of the pages and prevente property sheet closing if necessary
Problem:
- When i press OK button,and "return" , i can "cancel" the OnOK of that page only
- the OnOK was fired and the property sheet closes.
does any one knows how to do this? (i have searched the forums with no results)
thanks.
|
|
|
|
|
Override OnApply() (called when the Apply or OK buttons are pressed) and return TRUE to continue, or FALSE to abort the operation.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Im very new to the boost library, and have just started to intergrate the shared_ptr smart pointer into one of my applications. I am storing a lot of pointers (to objects) in a std::vector.
typedef boost::shared_ptr<cmyclass> my_shared_ptr;
typedef std::vector<my_shared_ptr> my_shared_ptr_vector;
What i need to do is to additionally store a reference to the same objects
(in the vector) in a CListCtrl (MFC). The CListCtrl allows you to associate
a pointer with each item (row) in the list control.
Before i used shared_ptr i used to add the data as below:
CMyClass pItem = new CMyClass();
my_vector->push_back(pItem);
CListCtrl::SetItemData->SetItemData(iItemNumber, (DWORD)pItem);
Now using shared_ptr (see below) i get a compiler error saying that it cannot convert from my_shared_ptr to DWORD.
my_shared_ptr myPtr (new CMyClass();
my_shared_ptr_vector->push_back(myPtr);
CListCtrl::SetItemData->SetItemData(iItemNumber, reinterpret_cast<dword_ptr>(myPtr));
My second question is if i was able to add the item data as ...
CListCtrl::SetItemData->SetItemData(iItemNumber, reinterpret_cast<dword_ptr>(myPtr));
...would the internal reference counter be incremented in shared_ptr?
My vector may be destroyed before my CListCtrl and I dont want the item data to be deleted until both are out of scope.
Thanks
Andy
|
|
|
|
|
See if this helps.
CListCtrl::SetItemData->SetItemData(iItemNumber, (DWORD)(void*)myPtr.get());
You can use reinterpret_cast twice if you like.
Hate is not a family value.
-pete
|
|
|
|
|
Thanks for your suggestion.
Does get() increment the internal reference count in shared_ptr?
From what ive read it doesnt.
|
|
|
|
|
how can i copy a complete partition into a back up file
if there is any API functions please send me or tell me the way i can make it.
|
|
|
|
|
Hello,
I have created an MFC application and have added Printing and Print Preview capability. The only problem i have is that the "Prev Page" and "Zoom Out" buttons on the Print Preview toolbar are always disabled. The "Two Pages" button and "Next Page" are enabled and work correctly.
For the Prev page button, I am setting the CPrintInfo::SetMaxPage() and CPrintInfo::SetMinPage() and CPrintInfo::m_nCurPage values in OnPreparePrinting() but this doesnt seem to make a difference. Also, shouldnt the Zoom Out button be enabled once ive clicked Zoom In???
Is their anything else that i can try which will enable these button?
Thanks
Andy
|
|
|
|
|
I am trying to create custom wizard where I want to add multiple projects to single solution file. In the script file (default.js) in the OnFinish() function I want to add some projects to the existing solution file.
Now if I added multiple projects using CreateCustomProject() function but when I actually create any solution I just see one project, other project remain orfan.
Please let me know which function to use to add the projects to the exisiting solution file. I'm using VS.NET 2003 for the custom wizard project.
Please HELP
Thanks.
|
|
|
|
|
I'm thinking of automatically configure the 802.11 wireless network without use the standard windows wizard.
Can any expert tell me which kind of steps and APIs I should use to achieve this object.
Thanks
|
|
|
|
|
Is there any way to compile only 1 cpp file in Visual Studio 2003? The build menu only allows you to build the whole project, but I want to compile only 1 source file. I could do it in VC6, but they removed the option, apparently. Do I have to use the command line to do this?
Thanks for any help.
tentons
http://www.griminventions.com
|
|
|
|
|
Don't know about menus, but I use Ctrl-F7 for that, just like in VC6 (I have VC++ key mappings)
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
It's still there.
Right-click on *.cpp file in solution tree, you'll see "Compile" option there.
And you can press ctrl+f7 as it was mentioned already.
Cheers.
|
|
|
|
|
How to make a button like MSN sign in button
and how to change she mouse to hand when the mouse is over the button...
thanks : )
|
|
|
|
|
|
I'm a newbie at this and I'm trying to find an easy way to reposition the controls accordingly in a dialog box when it is resized? (i.e. buttons, list controls, etc..) This includes being resized and also using the maximize/minimize
I've checked out some of the classes that you can add from codeproject.com but I wanted to know if there was a way to do it in the code.
Any help is appreciated.
|
|
|
|
|
Any reason why you don't want to use the classes for resizing supplied here in CodeProject? to make what you want, it will be necessary a lot of code to move each control. Why not to encapsulate that operation in an easy to use class?
If you want to know how it is done, just study the classes. They are easy to understand.
Jaime
|
|
|
|
|
Thanks for the advice Jaime.
|
|
|
|
|
I'm using VC4.2 (for specific reasons, so dont tell me to upgrade)
Some how I cant add breakpoints. I've deleted the ncb file and all obj/lib etc files.
Every time I set a breakpoint and hit run, it disables them. This happens w/ my debug and release version. I have 'generate debug info' set in my project settings.
Any ideas??
-C
|
|
|
|
|
hm.. this hapens when I try to set a breakpoint
in a cpp file, that belong to a DLL, which is loaded from the main programm..
try this:
_asm int 3;
but now you can only start with debuger attached
on the proccess.
|
|
|
|
|
I dont understand how this helps.
I'm creating a DLL and starting it with an exe. I want to stop and step through from a certain point. How does this help setting and steppin through code?
|
|
|
|