|
We also have numerous projects, with many people possibly modifying the resources at the same time (on different branches of source control). Eventually these branches are merged into the mainline code, resulting in duplicate resource IDs.
To resolve the issue, I wrote some macros (for VC++ 6.0) that will allow you to edit the resource.h file, select any portion of the resource symbols, and then it will renumber them with a user-specified starting number.
It only requires that someone take the responsibility to renumber the resources after merges - and we assign that to the developer that made the merge.
Here's the macros I use:
Sub RenumResType()<br />
'DESCRIPTION: Renumber resource IDs sequentially for a specified type of resource<br />
RType = InputBox("Enter the type of resource you want to renumber?" + vbLf + vbLf +_<br />
"Example: IDC_ or IDD_" + vbLf +_<br />
"Be sure to include the underscore if needed.", "Resource Type", "IDC_")<br />
if len(RType) = 0 then<br />
Exit Sub<br />
end if<br />
<br />
iStart = InputBox("Enter the starting resource number you want to use", _<br />
"Starting Resource ID", "1000")<br />
if len(iStart) = 0 then<br />
Exit Sub<br />
end if<br />
i = iStart<br />
<br />
<br />
ActiveDocument.Selection.StartOfDocument<br />
ActiveDocument.Selection.SelectLine<br />
ActiveDocument.Selection.SelectAll<br />
StartLine = ActiveDocument.Selection.TopLine<br />
EndLine = ActiveDocument.Selection.BottomLine<br />
ActiveDocument.Selection.StartOfDocument<br />
for lineno = StartLine To EndLine<br />
ActiveDocument.Selection.SelectLine<br />
CurrText = ActiveDocument.Selection<br />
pos = InStr(CurrText, RType)<br />
if pos > 0 then<br />
ActiveDocument.Selection.EndOfLine<br />
ActiveDocument.Selection.WordLeft dsExtend<br />
ActiveDocument.Selection = i<br />
i = i+1<br />
end if<br />
ActiveDocument.Selection.StartOfLine<br />
ActiveDocument.Selection.LineDown<br />
Next<br />
ActiveDocument.Selection.StartOfDocument<br />
End Sub<br />
<br />
Sub RenumSelRes()<br />
'DESCRIPTION: Renumbers the selected resources sequentially<br />
CurrText = ActiveDocument.Selection<br />
if Len(CurrText) = 0 then<br />
MsgBox "No text has been selected"<br />
Exit Sub<br />
end if<br />
<br />
iStart = InputBox("Enter the starting resource number you want to use", _<br />
"Starting Resource ID", "1000")<br />
if len(iStart) = 0 then<br />
Exit Sub<br />
end if<br />
i = iStart<br />
<br />
StartLine = ActiveDocument.Selection.TopLine<br />
EndLine = ActiveDocument.Selection.BottomLine<br />
for lineno = StartLine To Endline<br />
ActiveDocument.Selection.GoToLine lineno<br />
ActiveDocument.Selection.SelectLine<br />
CurrText = ActiveDocument.Selection<br />
pos = InStr(CurrText, "#define ")<br />
if pos > 0 then<br />
ActiveDocument.Selection.EndOfLine<br />
ActiveDocument.Selection.WordLeft dsExtend<br />
ActiveDocument.Selection = i<br />
i = i+1<br />
end if<br />
Next<br />
ActiveDocument.Selection.GoToLine StartLine<br />
End Sub<br />
As you can see, there are two macros here - one will renumber all resources of a given type (IDC_, or IDS_, etc) and the other renumbers all resources you have selected.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi Maximilien,
ResOrg will spot resource ID conflicts either within or between files, generate detailed HTML reports showing them, and be used to renumber selected symbols via a symbol renumbering wizard.
I'd suggest a few things to make the process of managing IDs easier:
- If you can, namespace your IDs by module (e.g. IDC_MODULE1_NAME, IDC_MODULE1_FREQUENCY). That way you'll be able to see at a glance which module the symbol originates in.
- Allocate a defined range of symbol values for each module. That way, clashes between modules (which can cause some really odd behaviour if you're using MFC Extension DLLs) are far less likely.
- Give someone on the team responsibility for managing IDs, and make others listen to them (from experience, this is usually the hardest part)
Good luck! If you have any specific queastions about ResOrg or how to use it, please feel free to ask.
Anna
Riverblade Ltd - Software Consultancy Services
Anna's Place | Tears and Laughter
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
|
|
|
|
|
|
|
Not replying to Max but more to the thread... I need to establish source control on a multideveloper VIsual Studio project. Early on, we ran into problems with two or more developers working in the UI area. Merges just didn't happen easily. What we do now, and it has never failed us, is that we have a baseline project, and we cut/paste new dialogs from the new projects to the baseline. This ends up copying all of the dialog description plus the binary stuff at the end (VS knows how to completely copy the dialog object....).
Stop groaning - it works, and we were new to the IDE 18 months ago.
Now, I see that people just "check in" their new resource files, and, assuming there are no resource conflicts, Visual Source Safe knows how to merge the resource files correctly?
I know, I know - try it, and I will, but I'd like someone to confirm that it should work like this.
Thanks
C. Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
|
|
|
|
|
Hi to everybody,
I am developping a graphic ActiveX that displays several IP addresses around a circunference and linked between them. it can occur that if there are a lot of IPs, they couldn't be seen properly. For that I would like to be able to zoom an area of the screen.
Is there any possibility to do this easily?
Thank you very much.
Javier
|
|
|
|
|
See if this article is of any help.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
I have a structure which composes of structures , which is further nested with structures and the nesting goes for a certain depth .If i use this main structure in a class i have to initalize the whole of the structure their nested mambers which takes a lot of overhead while coding .Is there a faster way ot initialize this?
for eg:-
typedef struct
{
A *a;
B *b;
}Main;
typedef struct
{
A1 *a1;
A2 *a2;
}A;
typedef struct
{
A11 *a11;
A12 *a12;
}A1;
similarly for A2,B,B1,B2......and so on for all the nested members. if i have to use it in the class it takes a large overhead while initialising all the members using 'new' operator . Is there a better way of redesigning this coding?
hitherto shall thou come but not further thee
|
|
|
|
|
One alternative would be to initialize structure each in its own constructor.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
How does one convert WCHAR to wchar_t?
I am the handsome one in the crowd.
|
|
|
|
|
No conversion needed.
WCHAR is wchar_t typedefed
typedef wchar_t WCHAR;
« Superman »
|
|
|
|
|
TCP is a connection-oriented protocol, UDP (User Datagram Protocol) is a connectionless protocol. Can some one tell me the simple meaning or a scenarion of connectionless connection ?
|
|
|
|
|
if i remember well (not sure at all so ) you can use UDP when you send packets to a whole network (not a determined peer).
now, if anybody knows much, i give up
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
TCP provides reliable data delivery, while UDP does not.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
In simple terms, TCP is like a telephone call, where UDP is like a radio. Anyone who wants to listen to the radio must tune in to the proper station, or for UDP, they must "join" to the proper network address.
The radio station doesn't know or care who is listening (other than marketing and ratings, of course), just as the UDP sender doesn't worry if packets are lost or dropped. One use is for sending streaming video or audio where the sender just sends and whoever has "joined" gets to see the show.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Please some go through the code for UserCreate dialog and
give me the reason why i could not able to see the text box fields
as there are more than six and seven dialogs being called in Mainframe.cpp file. Each dialog has gone through the MFC App wizard
as this is the MFC SDI application calling ATL Dlls through COM+
instantiation.Please help me out whether I need to overload the
constructor in UserCreate class which MFC App is not allowing me to do
or any other suitable way to get it done as first as possible.
OnOk handler of UserCreate dialog, I could not see the entered data
in text fields while debugging. Please help me out if anyone knows.
/*********************************************************************/
#if !defined(AFX_USERCREATE_H__C3AEA7E6_8028_4C75_AA4F_971C95CE0BB7__INCLUDED_)
#define AFX_USERCREATE_H__C3AEA7E6_8028_4C75_AA4F_971C95CE0BB7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// UserCreate.h : header file
//
#include "Sample.h"
/////////////////////////////////////////////////////////////////////////////
// UserCreate dialog
class UserCreate : public CDialog
{
// Construction
public:
UserCreate(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(UserCreate)
enum { IDD = IDD_DIALOG_CREATEUSER };
CString m_CreateUserName;
CString m_CreateUserPassword;
CString m_CreateUserIDType;
CString m_CreateUserType;
CString m_CreateUserDesc;
//}}AFX_DATA
//{{AFX_VIRTUAL(UserCreate)
public:
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//{{AFX_VIRTUAL
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(UserCreate)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(UserCreate)
afx_msg void OnUserCreate(char* lpszCreateUserName,char* lpszCreateUserPassword,char* lpszCreateUserIDType,R lpszCreateUserType,LPTSTR lpszCreateUserDesc);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_USERCREATE_H__C3AEA7E6_8028_4C75_AA4F_971C95CE0BB7__INCLUDED_)
/*********************************************************************/
|
|
|
|
|
Prasannajit Dash wrote:
give me the reason why i could not able to see the text box fields
Have they been added to the IDD_DIALOG_CREATEUSER dialog template?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
The api GetTimeZoneInformation returns the TimeZone.The 'StandardName' variable of TIME_ZONE_INFORMATION structure is unsigned short[32].How can I check if the time zone is IST or so?Please explain.I am in need of this very much.
|
|
|
|
|
You can use _wcsicmp function to check it.
_wcsicmp(tz.StandardName, L"IST")
« Superman »
|
|
|
|
|
Write a C++ program that has class
1) math
Our math class has only one data member number and member function display that will display the data member number.
Write the constructor of our math class that will initialize the data member number with the value zero.
Our program will overload the following operators.
1. Plus +
2. Minus -
3. Multiplication *
After overloading these three operators our program will be able to add, subtract and multiply our math class object with the integer in main() after overloading these operators we should be able to write these statements in main().
math obj1, obj2;
obj1= obj2 + 10;
Above statement will call the member function operator + () and will add the 10 in the data member of obj2 and finally will return the math class object. Similarly we also overload the multiplication operator * and minus operator – so that our math class object will be able to multiply and subtract from integer values.
Also our plus + overloaded operator should be intelligent enough to accommodate the following statement in the main() function.
math obj1, obj2;
obj2= 10 + obj1;
for this we will have to write friend function that will be called automatically and will add the integer value 10 in the data member of obj1 and finally will return the math class object . Similarly write two more friend functions that will overload the multiplication and subtraction operator so that we will be able to write the following statement in the main() function.
math obj1, obj2;
obj2= 10 *obj1;
obj2= 10 - obj1;
Output should be similar to the following:
Sample output 1:
adding integer 10 in the object using statement: obj= obj + 10 ;
10
adding integer 10 in the object using statement: obj= 10 + obj;
20
Multiplying object with integer 20 using statement: obj= obj * 20 ;
400
Multiplying integer 20 with object using statement: obj= 20 * obj ;
8000
Subtracting 20 from object using statement: obj= obj - 20 ;
7980
Subtracting object from 10 using statement: obj= 10 - obj ;
-7970
The Code i wrote is below:
#include <iostream.h>
#include <stdlib.h>
#include <conio.h>
class math
{
private:
// Private data member of the calss math
int number ;
public:
// Constructor for math class
math() : number(0) {}
// friend functions
friend int operator+(int,math);
friend int operator-(int,math);
friend int operator*(int,math);
};
// Main function of the programm
void main ( )
{
math m1,m2 ; //create an object of class myClass1
int obj2;
cout << "adding integer 10 in the object using statement: obj=obj + 10 "<
|
|
|
|
|
Wow, I can see that the copy/paste functionality works fine on your computer .
Ok, but what's the question ? You want us to do your homework for you maybe ?
You will have more success if you post SPECIFIC questions, for the parts where you are stuck. Also, try to use the formatting tags when posting code !
|
|
|
|
|
i jst want u to chk my code that is giving sme errorz and i wrote the code in my qustion . Reply if u really wanna hlp.
|
|
|
|
|
rose aashii wrote:
i jst want u to chk my code that is giving sme errorz
What errors? Compiler, linker, run-time, assertion, exception, etc. Have you single-stepped through each line of code to see where you get unexpected results?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|