|
Is there anyone who could tell me how to save a custom binary resource item as a binary file to disk? I want to include some data in my final exe which should be written to disk when the program first runs (sort of sfx). TIA.
|
|
|
|
|
If you have a pointer to the item, CFile allows you to write a chunk of data by specifying the start address and length - see my exmaple to the question above this one, it works just as well for any pointer you want to pass it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
i downloaded an old cpp program and it uses something like textcolor fn.
but my cpp help doesnt know it at all.
what do i have to include ? or where do i find it?
|
|
|
|
|
Is it a console program ? I believe some other compilers had stuff for this sort of thing, from memory someone else asked about it. It's certainly not a standard function under Visual C++. If you can explain exactly what it needs to do ( i.e. is it in a window or a console, is it just setting the colour for a block of text, etc. ), I'm sure we can help more.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
this is a sample of the program:
(it is i think a dos prog)
void background(void){
int a;
clrscr();
for(a=1;a<2000;a++){
textcolor(1);
textbackground(7);
cprintf("°");
}
gotoxy(1,25);
for(a=1;a<80;a++){
textbackground(7);
cprintf(" ");
}
}
|
|
|
|
|
Hello, I would like to know if choosing "mfc as a shared DLL", the interface of my programs will be like the new interface of windows XP.
Thank you in advance.
|
|
|
|
|
It will make no difference whatsoever - you will still link to the same dll if it's static or dynamic. All apps under Window XP look different ( I am using it ) because of how it shows things like the system menu ( the buttons on the top right of a window ), the window frame itself, etc. Every app I have written, static or dynamic, all look the same under XP, they all have the XP look and feel about them.
Apps will look like they are under XP if they are under XP or if you hack the absolute hell out of them to try and make them look similar. Otherwise, they will look like other apps under the version of Windows you are running. Also, if you want to write using newer features of Windows that require later versions of the OS, you'll need to get the Platform SDK from the Microsoft site ( download at your peril, I always get the CD ). Note that using functions like TransparentBlt will render your code inoperable under earlier versions unless you late load the dll's required and do some checking of your OS version to ensure that functionality not supported by the OS is not offered to the user.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Explain what you mean?
Do you mean keep the interface that XP has when running your app in another OS?
|
|
|
|
|
|
I have programmed a system tray icon into my program using traynot.cpp and traynot.h.
When I run the program, it works fine and then I press minimise and a grey space comes up.
I know its all correct because I tried it in Windows 98 and the system tray icon shows up!
Anyone know what I can do?
Thanks
Ashman
|
|
|
|
|
Hello
I do a program with vc++ that based on dialog, but the problem When I press Enter key the program is closed, How can avoide this problem.
thanks for your help .
|
|
|
|
|
In your dialog class override CDialog::OnOK() and dont call CDialog::OnOK() in it.
The same goes for Esc, override CDialog::OnCancel() in your dialog class.
|
|
|
|
|
The same thing should be done when using CTabCtrl.
[]'s Cris
|
|
|
|
|
See the VC forum FAQ.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
Hi all,
I created array with COleSafeArray ...
Now, i don't know how to destroying that !
Clear or Destroy or DestroyData ?
Which one ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
If it's just going out of scope, then you surely don't need to do anything - the destructor should take care of it for you. If you want to reuse the array, then DestroyData looks like a winner, if you want to kill the existing array as well as everything in it, then Destroy() will do the trick.
If you're using MFC then you can run in debug mode (F5) and when you close VC will let you know of any memory leaks, so if that is your concern ( for example, it's a COleSafeArray*), then that is a good way to see if you've leaked memory or not.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi, All.
=======
I have an API console application.
Does anyone know if I can and how to change/set the icon ?
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
If you need to support many Windows flavours then give this a try;
TCHAR szTitle [ 1024 ];
::GetConsoleTitle ( szTitle, 1024 );
HWND hWnd = ::FindWindow ( NULL, szTitle );
if ( NULL != hWnd ) {
HICON hIcon = ::LoadIcon ( ::GetModuleHandle ( NULL ),
MAKEINTRESOURCE ( IDI_MY_ICON ) );
if ( NULL != hIcon ) {
::SendMessage ( hWnd, WM_SETICON, FALSE,
reinterpret_cast<LPARAM>( hIcon ) );
}
}
Ofcourse you'll want to play nice and free the icon resource when your done, but you get the idea.
If your using Win2K you should take a look at GetConsoleWindow function and use it to replace the FindWindow code listed above (because depending on the console's title the above code might no always work as expected).
cheers,
Ben Burnett
"It's all absolutely devastatingly true -- except the bits that are lies"
- Douglas Adams
|
|
|
|
|
|
Almost forgot...
Because I'm using a console application I prefer not using resources,
I think I would like to load it from a file.
I'm not checking the MSDN, 'cause... I'm lazy I guess.;)
If you can help me, ... Thanks.
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
::LoadImage is what you want.
HANDLE LoadImage(
HINSTANCE hinst,
| LPCTSTR lpszName,
UINT uType, = IMAGE_ICON
int cxDesired, = 0
int cyDesired, = 0
UINT fuLoad ); = LR_LOADFROMFILE | LR_DEFAULTSIZE
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Thank you guys, for helping me.
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
From MSDN:
Note Because the Win32 message LB_ITEMFROMPOINT works only with Windows 95, ItemFromPoint, which wraps the Win32 message also works only with Windows 95.
I am using Win98 and it works fine, does this function work with NT/2000/XP and if not, what is the alternative?
---
Blessed are those who can laugh at themselves, for they shall never cease to be amused
|
|
|
|
|
Works fine under Windows 2000. The possibility that a message would be removed ( thus breaking software for newer OS's ) seems odd to me. I reckon you're probably pretty safe to use it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I am trying to find the current directory of my application on a HPC2000 operating system using Visual C++ 3.0 Embedded. The function GetCurrentDirectory does not seem to exist for the embedded environment. Anybody solve this problem, or have any hints to get me started.
Don
|
|
|
|