|
I do not fully understand what may be going on (what's SK_DEFINE_CLASS ), but:
Is XLC_AssginSpan defined in another DLL? Because if this is the case you must also link with the .lib file of that dll.
Best regards,
Alexandru Savescu
|
|
|
|
|
XLC_AssignSpan is defined in another header and i have included that header accordingly.
note:
#define SK_DEFINE_CLASS(cls) \
SKC_ClassDesc *cls::myDesc = NULL;
it is invoked in the implementation file of the class.
i really appreciate the help... thanks
|
|
|
|
|
In WorkSpace Window Click the FileView Tab
Then in Select your project and right click on it.
Then select Add Files to Project.
Then you can select your file from FileDialog.
This would suffice
|
|
|
|
|
Hi,
I have an application (VC++) which has 20 classes..
Actually its taking lot of memory while running..
Is there an way i can reduce that..
Also If i put some Classes in a DLL (MFC).. would it
help reducing the memory usage.. i mean, then it would
only load the class when actually required..
Ne ideaz
Sameer
|
|
|
|
|
Sameer Maggon wrote:
Actually its taking lot of memory while running..
Is there an way i can reduce that..
First, make sure you actually have a problem. No sense wasting time on optimizations that aren't really necessary. Next, find out what's actually using the memory. Is your compiled code that large, or are you allocating a lot of memory at run time.
If your code is large, it probably isn't worth the effort to shrink it, but do a search for optimization on CP; there are a couple of articles on it.
If you are allocating a lot of memory at runtime, you need to narrow down even further, and identify what algorithms need it; there is always a trade off between size and speed, and quite often you can rewrite a given algorithm to use less memory without taking a huge speed hit.
Sameer Maggon wrote:
Also If i put some Classes in a DLL (MFC).. would it
help reducing the memory usage..
Unless you have some routines you use very infrequently and can afford to unload when you're done using them, moving code into a DLL will probably make your memory footprint slightly bigger.
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
Sameer Maggon wrote:
I have an application (VC++) which has 20 classes..
And that matters... how? You provide no info on the size or complexity of them.
Actually its taking lot of memory while running..
Is there an way i can reduce that..
Yes, but it does involving knowing what you do. I'm sorry to say this, but if you even have to ask if there's a way you can reduce the memory footprint (again without giving any examples), it would seem to me you are currently not understanding what you are doing.
First and foremost I suggest you should try to learn C++.
|
|
|
|
|
The MS DataGrid is used in my program,but it doesn't worked on the machine whithout VC++ installed. I have registered the msdatgrd.ocx and have installed the MDAC2.7. The Error messages is : " Can't initialize data bindings" ,
m_myDataGrid.SetRefDataSource( (LPUNKNOWN)rs ); //Error Message Ocurrors
VCBeginer
|
|
|
|
|
Hello!
You need to 'install' two dll's; MSBIND.DLL and MSSTDFMT.DLL. By 'install' I mean copy them to System (system32) and then register them with regsvr32.exe
It's a pity that MS doesn't have documentation or better, a real installation for this
Hope that this will help you!
// Mike
|
|
|
|
|
Hi,
call back function is said to be called by Operation system only. I want to make a call back funtion and control the time and place it is called. Can I make it?
Would you please append an example ?
Thank you.
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
Yes as long your application is still running! A callback function is "not much
than calling convention". In fact WINAPI and CALLBACK is
the same __stdcall . Do not confuse CALLBACK function and RPC!
int __cdecl _tmain(int argc, _TCHAR **argv, _TCHAR **envp)
{
myDebugCallback( TEXT("Hello world..." ) );
}
void CALLBACK myDebugCallback(LPCTSTR strMessage)
{
_stprintf(TEXT("Message: %s\n"), strMessage);
}
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
Anybody knows how to realloc a unsigned char __gc?
bytes = new unsigned char __gc[800];
now I want to make it 1000 move the pointer to bytes[800] and add 200 of information!
Anybody?
We really need an MC++ forum! Just for questions like this one!
Cheers
Al
|
|
|
|
|
You cannot realloc with the standard new operator. You will have to use malloc and realloc if you want to do this.
Or you can allocate a new pointer that is the size that you want, copy the data into that pointer and delete the old pointer.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I can't realloc a managed unsigned char, as far as I know ...
|
|
|
|
|
Well after all this answers ... (???) Because I posted this messages into the wrong FORUM! We really need a MC++ forum!!
Anyway, I created it a MC_realloc(unsigned char __gc[], int len) __gc[]
The pointer return is always different!
I just thought you wanted to know! I hope Chris creates a new MC++ forum soon!
Al
|
|
|
|
|
hi, new at this
what would the code be to start reading at the first letter (pointer maybe)of some text entered into a editbox and then displaying the text + 1 in another box.
thanks
|
|
|
|
|
Hmmm, here is an example...
First, let us assume hWnd1 and hWnd2 are the source and destination windows.
char szText [256];
GetWindowText (hWnd1, szText, 256);
if (strlen (szText) < 255)
{
strcat (szText, "A");
SetWindowText (hWnd2, szText);
}
else
;
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Here is some code for dialog whose handle is hDlg, to read from an edit box called ID_EDIT1, and put the desired text in an edit box called ID_EDIT2:
int iLen;
HWND hEdit1 = ::DlgGetItem(hDlg, ID_EDIT1);
iLen = ::GetWindowTextLength(hEdit1);
if (iLen < 0)
{
return;
}
TCHAR *pszText;
pszText = new TCHAR[iLen+1];
if (NULL == pszText)
{
return;
}
::GetWindowText(hEdit1, pszText, iLen+1);
HWND hEdit2 = ::GetDlgItem(hDlg, ID_EDIT2);
::SetWindowText(hEdit2, pszText + 1);
Good Luck!
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have an HTML doc in my app's Path. I want to launch IExplorer to open it from my program. How do you do this if you don't know where IExplorer is installed?
|
|
|
|
|
You don't have to know. If you use ShellExecute indicating only the file to open, the system will find automatically the appropriate program (IE in your case) to use.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have files with the format:
number, "words", "words", "words", numbers
number, "words", "words", "words", numbers
etc...
I need to read each individual thing( number or "words") in between the commas. I originally checked each caracter to see if it was a comma. If it wasn't I added it to a string then got the next character. If it was a comma then I have my the thing between the commas. This arose two problems. (1)I can't get spaces because I'm reading the file using ifstream. (2)There can be commas in "words" thus ending the string before I read the complete string.
My solution(I dont like it): Because all "words" are surrounded in quotes I could check to find if it has reached the real comma, which i think would add a lot more code But this still doesn't fix the spaces problem. Should I drop the ifstream and use another file reading meathod( I don't know of any)?
[edit]
Oh yeah, the number does not need to be read as a number, it can be read as a string/char.
-Raffi
|
|
|
|
|
Use a tokenizer like <a href="http://boost.org/libs/tokenizer/index.htm">boost:tokenizer</a> . It seems a little overwhelming at first, but comes equipped with a predefined setting for exactly the kind of thing you want to do (check <a href="http://boost.org/libs/tokenizer/escaped_list_separator.htm">escaped_list_separator</a> .)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
iostreams is made for this.
ifstream f ("c:\\myfile.txt");
int n;
string a, b, c;
f >> n >> "," >> a >> "," >> b >> "," >> c;
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
I think iostream s won't handle strings enclosed in quotes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Oh. I don't know about that, but I took the quotes to mean 'this is a string', not 'this is a string in quotes'
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Even assuming the format is very well behaved, iostream s won't work. Consider for instance:
5, "hello", "my", "friends", 10 The first "word" read would be "hello", (comma included), as it is only white space that will stop the stream reading a token.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|