|
I thought that it would be simple like that too. It just named all the floating dailog bars whatever I typed in the last time I called SetWindowText().
-- Steve
|
|
|
|
|
Hiya what is the way best to completely clear a text file so I can use it again and again??
Also how do I display the date "230303", reading it from the system??
Thanks,
grahamoj.
|
|
|
|
|
To clear a file
<br />
FILE* file;<br />
file = fopen("YourFile.txt", "w+");
Probably not the best way, but it works for me.
Kevin
|
|
|
|
|
You can use the strftime function to format a time/date string or you can use GetSystemTime to get the current time and date from the system.
|
|
|
|
|
I need somebody more litirate than I am to tell how to use some MFC classes in my program, but not creating the MFC project.
I was surprised by the following fact. Then I wrote a simple program which were using CAsyncSocket, and SocketInit() function everything was working Ok (I have choosen "Use MFC as shared Dll" in my Project Settings). After, I have decided what it's enough to do the job what is allready done. So, I have found the CPop3 class on CodeProjecta.com. This class uses some other MFC classes so I have done everything like in previous case. But as result I have recieved the error in AFXV_w32.H which required usen't windows.h MFC applications. I'm not able to find a place in the program where this header is included, and I think I won't be able. But this is not important. It's important if somebody expirianced will learn me how to use some suitable MFC classes in my program, would explain me how MFC is working (may be some books or links)
Need your help!!!
|
|
|
|
|
May I get handle of the resource (bitmap or icon) by his name and not his ID.
For example,
HBITMAP hBitmap = GetBitmapFromResource (_T("IDB_BITMAP1"));
If it possible then how can I do it?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
From MSDN:
<br />
HBITMAP LoadBitmap(<br />
HINSTANCE hInstance,
LPCTSTR lpBitmapName
);<br />
Hope this helps.
Rgds,
Nirav
* The world stands aside to let anyone pass who knows where he is going! - David Jordan *
|
|
|
|
|
This method work if pass ID as string. For example "#136". But I need pass the string name of resource, for example "IDB_BITMAP1"
Best regards,
Eugene Pustovoyt
|
|
|
|
|
HINSTANCE hinst = AfxGetInstanceHandle();
HBITMAP hBitmap = LoadBitmap(hinst, MAKEINTRESOURCE(IDB_BITMAP1));
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
No this don't work.
MAKEINTRESOURCE macro converts an integer value to a resource type compatible with the resource-management functions. But I need get resource from his string name and not his ID
Best regards,
Eugene Pustovoyt
|
|
|
|
|
You can't. "IDB_BITMAP1" is not stored anywhere in the resources, it is #defined to a number. You can use a string resource IDs by naming your bitmap "IDB_SOMETHING" (including the quotes), but you can't have a number and string for the same resource at the same time.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Hi,
1) I am going to purchase a Visual C++ Professional
Edition 6.0, I think it will contains InstallShield
Wizard ... but when I tried to read its features, I did
not see any thing mentioning about it?
- Anyone is sure about this?
2) To build a distribution kit, this InstallShield Wizard
looks like missing some dll's to use with DAO/MS Acces Engine?
If I have to merge some dll from MSN 's website ... is it
legal to distribute my application to the third party?
Many thanks,
|
|
|
|
|
ATC wrote:
1) I am going to purchase a Visual C++ Professional
Edition 6.0, I think it will contains InstallShield
Wizard ... but when I tried to read its features, I did
not see any thing mentioning about it?
Yep, it does.
ATC wrote:
2) To build a distribution kit, this InstallShield Wizard
looks like missing some dll's to use with DAO/MS Acces Engine?
If I have to merge some dll from MSN 's website ... is it
legal to distribute my application to the third party?
Not sure, sorry. I believe the DAO libraries are a legal redistributable, so I don't think there will be any problems.
Ryan
He who laughs last thinks too slowly.
|
|
|
|
|
am an university student in electronic engineering dept.
I got 3 years to complete it. I've got a good knowledge of C/C++ and nowadays I'm working on MFC. when I try too look at the future, i cant see so much. so i need advices about fields to be concentrated. i mean i wanna know that what's hot and what's at the top. i also care about the amount of money that i'll be earning.
some keywords about that "fields":
database, TCP/IP, ATL.....
What about the future of game programming?
thank you...
|
|
|
|
|
You should probably post this in the lounge[^]. You'll get a lot more answers then (relevant as well as irrelevant ).
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
Hi
Anyone have a solution for class redefinition ??
I have a based class and 2 derived class. When i try to write a main function using both the derived class i have a class redefinition problem. Can anyone guide me on how to solve the prob ??
Thanx a lot !!!
bk
|
|
|
|
|
Its not very clear what you mean, maybe you can give an example of what you are trying to do?
|
|
|
|
|
eg:
base class :
class Employee
{
}
derived class 1:
class Temp:public Employee
{
}
derived class 2:
class Perm:public Employee
{
}
main:
#include "Perm.h"
#include "Temp.h" <- this is where the redefinition occur due to 2 copy of "Employee.h"
void main (void)
{
Temp a;
Perm b;
......
}
so beside changing the structure any solution to solve this prob ??
thanx a lot !!
bk
|
|
|
|
|
You need to protect the header file from multiple inclusions.
A portable way is to do something like this:
#ifndef __FILE_H__
#define __FILE_H__
#endif // __FILE_H__
If you are not worried about portability and is using VS.NET, you can write something like this:
#pragma once
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
|
It automatically protects header files. A VS.NET extension which IMHO should be incorporated into C/C++. Idiot proof protection!
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
me leaving the class room looking down my shoes.
[edit]#pragma once is not a VS.NET extension.[/edit]
|
|
|
|
|
.S.Rod. wrote:
[edit]#pragma once is not a VS.NET extension.[/edit]
Did it appear earlier? I assumed it was first included in VS.NET because VS.NET was the first environment where I noticed that the wizards generate code containing #pragma once.
Speaking of extensions, do you know by any chance if you can force folding points in C++ source files using some [un]documented trick? #region is what I want, but that seems to be a C# only feature.
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
Jörgen Sigvardsson wrote:
Did it appear earlier? I assumed it was first included in VS.NET because VS.NET was the first environment where I noticed that the wizards generate code containing #pragma once.
As far as I can tell it was already available with MSDEV 97.
Jörgen Sigvardsson wrote:
Speaking of extensions, do you know by any chance if you can force folding points in C++ source files using some [un]documented trick? #region is what I want, but that seems to be a C# only feature.
There is no way to force outlining. But the context menu shows a way to play with outlines regardless of the language you are using (they are saved in the .suo file, like bookmarks and other stuff). More info here[^].
|
|
|
|
|
.S.Rod. wrote:
But the context menu shows a way to play with outlines regardless of the language you are using (they are saved in the .suo file, like bookmarks and other stuff).
Yeah, I knew about that one. However, the .suo file is nothing I want to keep in CVS. The main reason I wanted to add the regions was to promote readability (hiding all the private stuff as much as possible which is of no interest anyway for the user of the class) and have it inlined in the code. Oh well, I guess I can't have everything.
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|