|
Hi all,
I'm trying the following:
token = strtok( buffer, seps );
while( token != NULL )
{
updbuff[x] = token;
_splitpath(updbuff[x],drive, dir, fname, ext);
sprintf((char*)updpathbuff, "%s.%s",fname, ext);
h_updPathbuff[x] = updpathbuff;
token = strtok( NULL, seps );
x++;
}
But with every loop occurrence, I overwrite the pointer h_updPathbuff .
I know what the problem is, but I don't know how to fix it
Can someone please help.
Thanks in advance.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Instead of copying the pointer, you should copy the contents of the pointer. updpathbuff will always point at the same memory location, so if you store this pointer in an array and then you write something else in it, the contents of the pointer in the array will also change (because both pointers point at the same memory location). So, what you should do is use strcpy to copy the contents in a new pointer. But you should be carefull doing this: the pointer where you copy the data should be valid and the allocated memory should be big enough to accept the data.
I highly suggest that you copy the content in a std::string instead, so you'll get rid of all the problems of memory management.
|
|
|
|
|
|
Hi
All
I create owner drawn menu in VC++6.0 and now i want to create my own font and set it to menu and its items so that menu will display in desired font.So please give some hint that where i write code for creating font.
Regards
Atool
|
|
|
|
|
|
|
See WM_CTLCOLORBTN for button and WM_CTLCOLOREDIT for edit constols
|
|
|
|
|
|
MSDN has examples but see here[^]
|
|
|
|
|
|
Also note that it won't work for buttons unless they are owner-draw buttons.
WM_CTLCOLOR works on edit controls fine.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
When I try to compile my old code in Visual C++ 2005, I get the error message
error C2990: 'Cg2HashTable' : non-class template has already been declared as a class template
with the code
<br />
<br />
template <class lType><br />
class Cg2FixedList;<br />
<br />
template <class keyType, class dataType><br />
class Cg2HashTable;<br />
<br />
template <class KEY, class DATA><br />
class Cg2SortedList;<br />
<br />
<br />
class Cg2DataHandle {<br />
<br />
private:<br />
friend class Cg2FixedList;<br />
friend class Cg2HashTable;<br />
friend class Cg2SortedList;<br />
...............<br />
<br />
How can I fix this? Thanks!
Nacho
|
|
|
|
|
Hello,
I am trying to convert my project to use Visual C++ 2005. However, when I compile my project, I get a lot of warning message like this,
c:\dxsdk\include\d3d9types.h(1385) : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
How can I fix this? Thanks!
Nacho
|
|
|
|
|
Save the file d3d9types.h in unicode encoding.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Is this the only way, since I have a lot of other files have similar problems, is it means that I need to re-save all those files? Thanks!
Nacho
|
|
|
|
|
Nacho Chip wrote: is it means that I need to re-save all those files?
Yes. Save all such files in unicode encoding. You must have entered unicode characters into those files and so you will need to save it in unicode encoding to avoid data loss.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
|
Hi,
I am having a Help -->"Help on XXX" in my MMC, I am not sure how this menu Item is created.
When I click on this menu Item, the HLP file is not opening.
Please let me know how to open the HLP file?
Thanks,
Nagarjuna
Nagarjuna
|
|
|
|
|
Hi All,
I want to change settings of Internet Explorer programatically:
Select Tools->Internet options->Security tab
Click on customlevel button
UserAuthentication
Logon
Anonymous logon Radio button must be checked
This must be done programatically.
How do i do that?
|
|
|
|
|
For changer settings of internet explorer you can refer to this address on the registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
|
|
|
|
|
Which API to use so that i can change this settings.Particularly the parameters that i have to pass.
Thank u.Your response helped me know few things which i was unaware about.
|
|
|
|
|
|
I had read an article in MSDN for changing the proxy setting of options dialog.
It used :
INTERNET_PER_CONN_OPTION_LIST List;
INTERNET_PER_CONN_OPTION Option[1];
unsigned long nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
Option[0].Value.pszValue = "http://myproxy:8080";
List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 1;
List.pOptions = Option;
if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize))
printf("InternetQueryOption failed! \n");
But i was unable to find appropriate details for setting other options of the "options" dialog.
Ex: To set Tools->Internet Options->Security->Localintranet->custom level(button)->Anonymous logon option.
An article in MSDN mentioned that setting registry directly is not recommended.Is there an alternative way to solve this issue.
|
|
|
|
|
|
That source helped me set proxy settings.
I also need to set Tools->Internet Options->Security->Localintranet->custom level(button)->Anonymous logon radio button
How to do that?
|
|
|
|