|
How can I make my programs Unicode ready?
How do I compile them for Unicode?
What header files do I include?
wWw.KruncherInc.cOm - My cool programs
|
|
|
|
|
Please, look at International Programming Topics in MSDN
|
|
|
|
|
I need to position my child window (formview) at position 0,0 each time it starts up. I tried the line of code below but it doesn't seem to do the trick.
SetWindowPos(NULL, 0, 0, -1, -1,SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
Without the code, its position is set at 0,0. But each time I open that same window up, it keeps changing to the next cascading position. How can I prevent this and have it start at position 0,0 each time?
Thanks!
|
|
|
|
|
You are supposed to do this by modifying the CREATESTRUCT in PreCreateWindow , so:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.x = 0;
cs.y = 0;
return TRUE;
}
|
|
|
|
|
I inserted the above code and it still doesn't work. Each time I close the window and open it back up again, it moves to the next cascading position. I tried inserting similar code into BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) and it gives me the same result.
|
|
|
|
|
Rather than a round of the guessing game - - mail me a minimum copy of a project exhibiting the problem.
|
|
|
|
|
Hi,
I need to use a class that is outside of my DLL in my DLL. I've tried every way I know of, but I can't seem to accomplish it. I know you can export from a DLL, but can you import into a DLL?
The outside class is not in another DLL, it's free-standing in the project.
I'm not very experienced with DLLs, so any help is greatly appreciated...Thanks!
|
|
|
|
|
Keylee717 wrote:
it's free-standing in the project
If this means the class is in source-form, then just copy it over!
If it means it's part of an EXE, then Im afraid there is no easy way (if any) to import!
Bikram Singh
|
|
|
|
|
Hi Bikram
I would copy it over, but that class relies on other classes in the project. I can do it as a last resort and just copy all of the classes needed into the dll, but if I do that I may as well not use a dll and just put it all into the client project.
Thanks for your help!
|
|
|
|
|
Well, you needent really make a copy of the class and the classes it depends on...
Just add the class and the related classes to the VC++ file view..
Keylee717 wrote:
I can do it as a last resort and just copy all of the classes needed into the dll, but if I do that I may as well not use a dll and just put it all into the client project
So why not use a DLL? It's always better to do that, so that in future you have only one copy of the classes to maintain. With multiple copies, you, for example, fix a bug and you've got to fix the bug in all copies...
Bikram Singh
|
|
|
|
|
Hi there,
Is it okay to allocate memory using the new operator and then to reallocate it (expand/shrink it) by using realloc ?
...Or is there any better method that I should be thinking about?
Thanks,
David
|
|
|
|
|
No, new and realloc() are not compatible.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks for the reply.
DavidCrow wrote:
No, new and realloc() are not compatible.
What would you advise me to do then? Should I just new a new portion of memory, memcpy the contents and then delete the old one?
What would you say?
dNimrod#X
________________________
|
|
|
|
|
new is an operator, while realloc() and memcpy() are functions. If you want to be able to use realloc() , use malloc() instead of the new operator. Memory allocated by malloc() should be freed by calling free() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
dNimrod#X wrote:
Should I just new a new portion of memory, memcpy the contents and then delete the old one?
You can but new is best used for allocating fixed-size memory blocks and objects.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
DavidCrow wrote:
You can but new is best used for allocating fixed-size memory blocks and objects.
Ha, I see... so I'm better off using malloc from the start.
Thanks a lot for the valuable feedback.
dNimrod#X
________________________
|
|
|
|
|
What are you trying to do.
Is the memory for an object with a constructor/destructor ?
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cmk wrote:
Is the memory for an object with a constructor/destructor ?
No it's for a variable-sized custom control own content buffer -- it may need a larger/lesser quantity of memory at a given time. I therefore need to expand/shrink the buffer according to the needs at that exact time.
dNimrod#X
________________________
|
|
|
|
|
forget aout reallocating memory, for most.
a) new/delete call Ctor and DTor of the element(s), which alloc does not
b) realloc isn't as useful or performant as one would wish, unless you have a single-threaded application and all the reallocations happen in one "block" (in which case it's typically possible, if painful, to calcuilate the total length first and allocate once).
The worst performance hit is not overallocation, but fragmentation, and typical "container" or "string builder" classes are designed to minimize that. The overhead of allocating a larger buffer and copying data is often negligible.
I would recommend using a container with contiguous memory (such as std::vector<byte> for this.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
If the memory is just for 'blob' data (ie no constructors/destructors need to be called) then just use ?alloc/realloc/free.
The only real reason to use new/delete is to have the constructors/destructors called automatically.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Does anybody know how to change file associations from within M$ VC++ 6.
-Thanks
Mark
As you journey through life take a minute every now and then to give a thought for the other fellow.
He could be plotting something.
-Hagar the Horrible
|
|
|
|
|
A guess would be Shell API's and/or Registry entries.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
http://www.jrsoftware.org/isfaq.php#assoc[^] lists the registry entries needed to set up file associations.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi there, before you get ready to have a go at me... I do know very well how to declare variables. What I'd like to know if there is a number limit to the total amount of declarations that can be declared. You see, I'm creating a Win32Console app; the app will have a nice little number-accessed menu system - and the menus will have sub-menus. As you can gather, a lot of variables will be needed for the amount of choices that will be asked!
Can I organise my declarations on a separate file and link it to my main .cpp file? If so... could someone tell me please! Thanks for your help.
I'm using Microsoft Visual C++ 6.0 Standard Edition
drjake
|
|
|
|
|
drjake wrote:
if there is a number limit to the total amount of declarations that can be declared
Don't worry about that, just declare all the variables you need.
If you exceed the limit, whatever that is, post the information here so we will know... then shoot yourself for writing a pile of junk application that exceeded the limit of allowable variables.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|