|
Seems like you know the answer already!
One good thing about getting older, you don't lose the ages you've been!
|
|
|
|
|
I tend to just get a pointer to the Header Control and use GetItemCount.
Not sure why you'd want another way (of if there is one)
Michael
Errata 1: p. 154, section 'Defusing'. For 'red wire' read 'blue wire'.
|
|
|
|
|
How can I instantiate an Acrobat Writer application, please ?.
Thanks.
Aziz Rajim
|
|
|
|
|
Take a look at ShellExecute. You can specify an executable, or a data file. If you specify a data file, it will open the application designated for that type of file.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
... what do they do really...?
I'm using CVS and it's really annoying to be forced to commit ncb and opt files since they are modified/created over and over.
Can somebody shed some light on this?
Thx,
/Tommy
|
|
|
|
|
.OPT
The workspace options file, which stores information about the physical layout and characterisitics you’ve determined for Visual C++, such as window layout. In terms of source control, the .OPT file is not shareable.
NCB -- Parser information file:
This file contains information generated by the parser used by the class view and component gallery. If the file is accidentally or deliberately deleted, it is automatically regenerated.
You really don´t need them to cvs.
|
|
|
|
|
ok u can delete
the
.ncp,.opt.aps,.clw files from the workspace they dunno affect r workspace...and this may be done whenever the classview shows some errors for eg:one or more of ur clasess are disappeared from the clasview tab..
Renjith The True CP ian
|
|
|
|
|
Hi friends
Anybody can explain the better and effective way to copy the resources(all type of ) from many workspaces into one...
i can do it presently well..but i didint satisfiy with it..
R_Renjith The True CP ian
|
|
|
|
|
I Would simply edit the resource files by hand. I don't know what method you have tried but that is the fastest thing that I can think of.
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!
|
|
|
|
|
hi friend
Many Many thanks for your replay..
The method i follow is open the souce resouce file from the target workspace and drag and drop the resource from source to target...and the corresponding Dialog class.cpp and .h files are copied from source and add in to the targhet workspace and add that filesin to the target project...
i think there was some efficient and easy way than this..but i dunno how...if any one know just respond .....
Renjith The True CP ian
|
|
|
|
|
look at the resource.h and <projectname>.rc files.
Copy the pertinent pieces. The files are pretty clear about which parts do what. This will allow you to move/copy many controls/resources at a time.
One thing to remember, is you will have to make each resource Id unique, in the final project. Also at the bottom of the resource.h file are some constants used by the resource editor to assign resource ids. These must be set to the next largest unused number.
|
|
|
|
|
Problem with reading a string from the registry (example windows version).
I tryed this and it worked fine:
char* text;
//unsigned long* buffer;
DWORD* buffer;
unsigned long PerServer;
unsigned long Per1_0Server;
CRegKey reg;
reg.Open(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings");
reg.QueryValue(PerServer,"MaxConnectionsPerServer");
but when i try to read a string (the windows version name) with:
reg.Open(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion");
reg.QueryValue(text,"ProductName",buffer);
i get an assertation error on the line "pdwCount!=null;" (in CRegKey) if i change buffer to anything using "buffer=(unsigned long*)999;" i dont get the error but i get no data.
Am i being stupid? I cant see where im going wrong.
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
To use the CRegKey::QueryValue(LPTSTR szValue, LPCTSTR lpszValueName, DWORD* pdwCount) overload,
you'll have to have an allocated (or static) buffer for szValue and the size of the buffer in a variable pointed to by pdwCount before calling QueryValue()
<br />
#define TEXTLENGTH 120<br />
<br />
char text[TEXTLENGTH]; <br />
<br />
DWORD textlength;<br />
<br />
CRegKey reg;<br />
<br />
(... snip ...)<br />
<br />
textlength = TEXTLENGTH;<br />
<br />
reg.QueryValue(text, "ProductName", &textlength);<br />
<br />
|
|
|
|
|
Thanks, that got it going first time. thank you again - Lucky
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
ALWAYS USE API s.............THEY ARE COOOOOOOOOOOOOL
EXAMPLE IS:
HKEY hkey;
DWORD dwSize;
char szInstalledapth[MAX_PATH*2]
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Renjith\\",0,KEY_READ,&hkey)!=ERROR_SUCCESS)
{
MessageBox(HWND_DESKTOP,"Unable To oen registry","Registry Error",MB_ICONERROR);
return FALSE;
}
//Reading a String
dwSize=MAX_PATH;
if(RegQueryValueEx(hkey,"InstalledPath",0,NULL,(LPBYTE) szInstalledapth,&dwSize)!=ERROR_SUCCESS)
{
RegCloseKey(hkey);
return FALSE;
}
//////////READING A DWORD
DWORD dwLogLevel;
dwSize=sizeof(DWORD);
if(RegQueryValueEx(hkey,"LogLevel",0,NULL,(unsigned char*)&dwLogLevel,&dwSize)!=ERROR_SUCCESS)
{
RegCloseKey(hkey);
return FALSE;
}
//CLOSING THE REGISTRY
if(hkey)
RegCloseKey(hkey);
R_Renjith The True CP ian
|
|
|
|
|
Lucky the code machine wrote:
char* text;
//unsigned long* buffer;
DWORD* buffer;
unsigned long PerServer;
unsigned long Per1_0Server;
CRegKey reg;
You don't initialize your variables. do this instead:
TCHAR text[1024];
DWORD buffer = 1024;
unsigned long PerServer;
unsigned long Per1_0Server;
CRegKey reg;
reg.Open(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion"));
reg.QueryValue(text,_T("ProductName"),&buffer);
Often, when a method asks for a pointer to value, it asks for a placeholder to return something to you. but the this pointer must point to valid memory area. Also, note use of TCHAR and _T("").
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi all, just wanted to know if there is some way of blitting a 16-bit RSB graphic (manually loaded into memory using its unique binary template) to a 24-bit graphic surface? I realise that it could be done by normalising the 16-bit information of 2-bytes per pixel to three bytes per pixel and then blitting but there are two issues with this:
a.) I didn't want this extra step unless it was UNAVOIDABLE.
b.) I'm not sure where to start with the conversion process?
I'm using DirectDraw to blit to the screen, and some custom surfaces to store the graphic data (Basically I'm trying to blit from a 640x480 16-bit plain surface to a 800x600 24-bit primary surface (but only blitting to a 640x480 portion of it)). Any ideas/viewpoints on the matter would be well apreciated.
Regards all,
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
You will probably be better off going to teh GDI to do the color conversions for you. You can do this by asking your DirectDrawsruface for its DC then calling the GDI function.
There is really no other way to do this in DirectDraw unless you want to do it yourself, but I am willing to bet that the GDI will still be faster than what you could create.
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!
|
|
|
|
|
does somebody know if it´s possible get the supported read/write features from about a cd-rom/burner (so infos like supports reading CD-R, CD-RW, Read Speed, Write Speed) and somethin like that ?
|
|
|
|
|
|
thanx for info, could u give me a small hint why i have to look for like an API or whatever ?
Actually i only could figure out how the Check my IDE Controller For an CD-Rom or do the same think via the wnaspi32.dll.
But it seems both ways don´t have more information options left for me, so must i read the bios of the cd-rom ?
|
|
|
|
|
thanx for info, could u give me a small hint what i have to look for like an API or whatever ?
Actually i only could figure out how the Check my IDE Controller For an CD-Rom or do the same think via the wnaspi32.dll.
But it seems both ways don´t have more information options left for me, so must i read the bios of the cd-rom ?
|
|
|
|
|
I'm using SetTitle on a class derived from CDoc, but the title doesn't change. I've tried calling UpdateAllViews(NULL); but it still doesn't change.
Any ideas why and / or how I can change the title?
Ali
|
|
|
|
|
Where in your code are you calling SetTitle?
Michael
Errata 1: p. 154, section 'Defusing'. For 'red wire' read 'blue wire'.
|
|
|
|
|
At the end of OnOpenDocument - something like this
BOOL CSQMDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
// TODO: Add your specialized creation code here
CString szName = lpszPathName;
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
InitDocument(lpszPathName);
.......
.......
.......
SetTitle(TEMP_FILENAME);
return TRUE;
}
Ali
|
|
|
|