|
Thats totally correct, but in this case i'm in a source-code of the real MFC code
I need to copy the whole source-code of all cases of keystrokes to this MFC-Class
So i have a double source-code.
If the A-Key does create a new customer and the D-Key deletes a customer for example
i create this code in my class
If my colleague changes the source-code of the DOS-Application i need to change aswell the
source-code of the MFC-Class, that's pretty impractical. All work has to be done twice.
In my horror-code the DOS-Programmer changes simply the code in his DOS-way and the code also
changes in the MFC-logic...
It know, it's hard to understand why i do this, but it's really the onliest way to re-create
an application which contains over 2000000 lines of code and will also grow up during i code...
So i need simply an idea how to resolve my problem, however my kind of programmation is stupid or horrible
|
|
|
|
|
In my horror-code the DOS-Programmer changes simply the code in his DOS-way and the code also<br />
changes in the MFC-logic...
Here what does DOS-way mean? And how the changes are reflecting to the MFC code?
Come online at:-
jubinc@skype
|
|
|
|
|
I have for example a simple source-code ( .cpp & .h file) without classes, only static functions.
These functions are called from the DOS-code and aswell from my MFC-Classes :
For example
while(stop != 1) {
Grid.Execute(); //-> does the DoModal() and quits this function via the OnOK()
switch(Grid.PressedKey) {
case KEY_ESC: stop = 1; break;
case KEY_ENTER: /*traitement*/ stop = 1; break;
};
}
In the DOS-Application the .Execute draws with a lot of printf a Grid to the console
In my MFC-Application the .Execute opens a Dialog within a Grid-Control
If the user hit's a key, the Execute function ends and the switch(Grid.PressedKey) launches
If the key don't matches, the grid continues beeing displayed, until ENTER or ESCAPE is beeing hitted.
In DOS a #ifndef loads the header which defines the DOS-Grid and in the case of a windows PRECOMPILER-DIRECTIVE the header
for the Dialog will be loaded...
So this code is uniform to the application ...
You know what i mean? Because it's hard to explain in a brief text a whole project-logic
Greetz
|
|
|
|
|
Hi..
I am calling a DLL Methods through Command Line.I am getting errors..It is not Connecting to server.plz help me..
Error is..
p(214) : error C2451: conditional expression of type 'void' is illegal
Expressions of type void cannot be converted to other types
Code...
ACL_STATUS *Acl_Status;
HINSTANCE hClcltr = LoadLibrary("ACL_API.dll");
CONNECION connect2Server;
connect2Server = (CONNECION)GetProcAddress(hClcltr,"ACL_ConnectToServer");
CString sBuf;
CHAR *buf = sBuf.GetBuffer(MAX_PATH);
GetSystemDirectory(buf, 256);
lstrcat(buf,"\\shell32.dll");
sBuf.ReleaseBuffer();
connect2Server(aConfig[1], aConfig[2], aConfig[0], aConfig[5],Acl_Status);
--->(Error) if(connect2Server(aConfig[1], aConfig[2], aConfig[0], aConfig[5],Acl_Status ))
{
AfxMessageBox(_T("Successful"));
//AfxMessageBox("Succesful");
}
FreeLibrary( hClcltr );
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|
|
if(connect2Server(aConfig[1], aConfig[2], aConfig[0], aConfig[5],Acl_Status ))
In the above statement, the connect2Server function returns void and u r attempting to evaluate its return value, hence the error.
Possible Solutions:
1. Don't check (don't write it in if/while) the return value of connect2Server as it returns void.
2. Return some value from connect2Server, then evaluate its return value.
Come online at:-
jubinc@skype
|
|
|
|
|
Guessing by the error, it seems that the "ACL_ConnectToServer" function doesn't return anything. So, you cannot check its return value with a "if".
BTW, please read the posting guidelines which are at the top of this forum. Thank you.
|
|
|
|
|
How CONNECION is defined?
(I guess the connect2Server function has a out parameter, the last one looks promising, to return the result of the operation).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I want to convert CListCtrl items from Check Boxes to radio buttons
please let me know how can i do that
thanx in advance
|
|
|
|
|
There's no inbuilt method, u'll have to do it manually.
Come online at:-
jubinc@skype
|
|
|
|
|
hummm thanx for the info
let me know how to start of if u have any idea
|
|
|
|
|
ListCtrl needs to be made Owner Drawn. While drawing, use CDC::DrawFrameControl() to draw the radio button. Implement u'r own logic to get the selected Radio button item.
Come online at:-
jubinc@skype
|
|
|
|
|
Heyy Don
here is an other way i have done .. thought its useful for all so posting here
Create image list with cheked and uncheked dadiobitmap button images and and set it to list view control
CBitmap tmpBmp;
CImageList m_imgList;
m_imgList.Create(16,16,ILC_COLOR | ILC_MASK, 0, 255);
tmpBmp.LoadBitmap(IDB_RADIOBTNS);
m_imgList.Add(&tmpBmp, RGB(255, 0, 255));
myListCtrl.Create( Styles ,CRect(0,0,0,0), this, IDC_SOMEID)
//myListCtrl.SetExtendedStyle( set tyles what ever u want );
myListCtrl.SetImageList(m_imgList, LVSIL_STATE);
--
feel free to revert me back for info if any body needs more
|
|
|
|
|
sarat wrote: I want to convert CListCtrl items from Check Boxes to radio buttons
Are you wanting to ensure that only one item can be selected at a time?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Then make sure to use the LVS_SINGLESEL style.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello everyone,
How to get the performance counter index and name relationship? Is there a table?
(like integer 180 for working set counter)
I can not find from MSDN,
http://msdn2.microsoft.com/en-us/library/aa372648.aspx
thanks in advance,
George
|
|
|
|
|
Are there situations where you cannot refer to an item by its name? The performance API allows you to construct counters using a name. If I've misunderstood your question, please explain.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi DavidCrow,
I am reading some other people's code and it has a list of numbers (performance counter index), so I have to know how to get name by index.
regards,
George
|
|
|
|
|
But how do you know there is a corresponding name?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks DavidCrow,
I only know a rough name from perfmon tool, and I do not know whether it is exactly the same name which could be used to find the index by the API, and I think the API should do exact name match, right?
regards,
George
|
|
|
|
|
George_George wrote: ...right?
Until you can provide an example where a name is used in place of a number, I've no idea.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi DavidCrow,
I have found the result by,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\LangId
regards,
George
|
|
|
|
|
Since my machine uses English, it would be:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter
Now that you've "found" this, what exactly does it help you do that was not possible before?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry DavidCrow,
English is not my native language. You mentioned "what exactly does it help you do that was not possible before?", do you mean what objectives could I achive if I know the mapping between index and name of performance counter?
If I do not understand your points correctly, please say the sentence in some other words.
regards,
George
|
|
|
|
|
George_George wrote: ...do you mean what objectives could I achive if I know the mapping between index and name of performance counter?
Yes. I've done plenty of performance counter code, but have never needed such information. I don't do non-English stuff, however.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|