|
Hello,
I've tried using CreateIconIndirect to create a 256-color icon, by applying a 8bit bitmap in hbmColor. However the output icon is a 4-bit icon.. I'd appreciate if anyone can give me some help.
|
|
|
|
|
After you look at the icon data it is a 4-bit icon, or when you try to display it it is a 4-bit Icon?
|
|
|
|
|
I'm trying to print out a hex value say b to a file. But instead of printing out b it prints 11. Now I know 11 is B in hex BUT I want the letter b.
Here's one variation I have tried.
object output is a vector of ints.
for(int i = 0; i < objectOutput.size(); i++)
outfile << std::hex << objectOutput[i] << std::endl;
I've tried std::hex and std::setiosflags and many different variations and combinations but I still get 11. What am I doing wrong?
nay
|
|
|
|
|
how about this instead.
for(int i = 0; i < objectOutput.size(); i++)
outfile << setiosflags( std::ios::hex) << objectOutput[i] << std::endl;
|
|
|
|
|
I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck.
HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent);
ASSERT(hSel);
VERIFY(m_wndTree.SetCheck(hSel, TRUE));
Any ideas?
|
|
|
|
|
I'm just guessing here, but it could be that the tree needs to be redrawn. Try the following:
VERIFY(m_wndTree.SetCheck(hSel, TRUE));
m_wndTree.Invalidate();
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Nope, that's not the problem.
|
|
|
|
|
I had the same problem
Do a search on "Check boxes in CTreeCtrl" and take a look at the second reply from Tomasz Sowinski. This corrected my problem.
-kg
Ken Goguen
|
|
|
|
|
Is hParent a valid HTREEITEM?
Did You make a refresh?
Regards!!!!
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
is there any way to search a AnsiString?
|
|
|
|
|
Hy!
... you can tray strstr() function ...
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
I have a current project going at work and since I'm the only developer here would like to use you guys as a sounding board, hope no one minds. Here's my current project I have a text file that extracts total counts by different codes into a main text file. Here is an example of a couple lines from the text file:
3AAA, 789
4EFJ,R321 90
5BBB,3AAA 6
etc...
Now what I'm doing is reading in the file with CStdioFile and tokenizing each line and inserting relevant information into a structure like:
struct Data{
char* Code;
long Amount;
};
by using the strtok() function I have to keep a counter during the tokenizing portion of the program in order to back track from an array of struct Data I created in order to fill in the Amount field with the right amount. Because let's say for example I tokenize the 3rd string I get these tokens:
5BBB
3AAA
6
I do not get the amount value until the very end so I have to go back on 5BBB and 3AAA to add in amount 6. Now this file gets pretty big, and with just going through the array and looking up each string literal to see if it is there or not and then adding the amount I might be using more resources than I need to.
Question to anyone is there a more efficent way to do this? I'm not asking for code examples just methodology. If I got code examples then I couldn't figure out how to write it and then programming becomes no fun
But if there is a more efficient method to do what I'm proposing please let me know, and for further clarification just from the 3 lines at top the final output file looks like:
3AAA 765
4EFG 90
R321 90
5BBB 6
It works now, but I'm thinking there is a more efficent way of doing this...
TIA
HomeNuke
----
"Nuke'd Your Home, Yet?"
Run your own PostNuke based web server from home
http://www.homenuke.com
|
|
|
|
|
Hy!
You can applay 2 strtok. First you make strtok( line, " " ) and get 2 substring( one with the codes and one with the value ).
5BBB,3AAA
6
Then applay again strtok on the codes string and now you can complete your structure because you already have the value ... and as you can here is no backtracking
5BBB 6
3AAA 6
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Man, when you finally see the answer you hit yourself on the head! Thanks alot now let me see if I can implement this method
Thanks again, I'll let you know if it works, or should I say, if I can get it to work
HomeNuke
----
"Nuke'd Your Home, Yet?"
Run your own PostNuke based web server from home
http://www.homenuke.com
|
|
|
|
|
Just wanted to let you know your method works!
Thanks it is much cleaner than my previous code attempt. Now I just need to convert my fixed size array to a vector and it would be that much more perfect
Thanks again!
HomeNuke
----
"Nuke'd Your Home, Yet?"
Run your own PostNuke based web server from home
http://www.homenuke.com
|
|
|
|
|
Hi!
I've written a shell extension which allows you to explore you linux system from windows explorer. This works fine in 2k, but a slight bug is present when running under XP.
The symptom is that one has to selected folders with different distance from the root to force update of the right view
example: Selection changes from /etc to /etc/X11 => everything is fine.
/etc to /bin => the right view will still show the contents of /etc.
Among the implemented interfaces are:
IShellFolder2
IPersistFolder2
IPersistIDList
Anyone who has seen this problem?
|
|
|
|
|
Hello!
When you read my question I'm sure you understand that I'm very new with C++.
But i give it a try.
I'm working with some school-assignments and have a problem with removeSpaces.
I have a string which contains "Hello mate", and from my main function I want to call the function removeSpaces. Can anyone who is better than me tell me how to write in this function to get rid of these spaces, and at the same time count the spaces we got rid of?
I have some code here, if it helps?
void main(void)
{
String S;
S.setText("Hello mate" ");
S.removeSpaces();
S.display();
cout << S.length() << endl;
}
int String::removeSpaces()
{
return ?;
}
Kind regards The Swede
|
|
|
|
|
I think its good to take a look at CString:Trim(),TrimRight(),Find()
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi.
I have a finite array list of a data structure (some char and integers). I can write to a file with the update of the array list. For example, let say the array list holds an array of five data structures. I can write all contents to a file.
While the program can update a file with the latest content, it cannot *read* all data from the file. For example, let say the array list holds five data structures. Let say the array list was full when the program updated the database file. Thus, there are five complete data structures in the database file. When the program reads the database file and copy the data from the file into the same array list, it only reads *the first data structure*. In other words, the program can update the database file with new data structure, but it can only read one data structure from the file at any instances.
Here is how I get it to read data from the database file.
file.read(reinterpret_cast<char *="">(instanceofarraylist), sizeofdatabasefile);
What is the best way to solve this problem? I want to copy all context from the database file into the array list.
Last, is this problem related to the fact that the list is an array rather than pointer-base?
Thanks,
Kuphryn
|
|
|
|
|
How are you allocating your array and what does your structure look like?
|
|
|
|
|
Thanks.
The array list is typical. The data class contain integer and character as in numbers and names.
Anyways, I can try different ways to modify it.
Kuphryn
|
|
|
|
|
I would like to search a string in another string, by using a Windows API or a C function (not MFC).
Does a such function exist or not ?
Appstmd
|
|
|
|
|
char *strstr( const char *string, const char *strCharSet );
string = Null-terminated string to search
strCharSet = Null-terminated string to search for
|
|
|
|
|
|
For the real guru:
How can I - if at all possible - instantiate a Web Browser Control in a window, not using MFC?
I'd really appreciate something in the form of
CreateWindow("Class_Webbrowser", ...
but I have a faint feeling that's not all there's to it...
Comments please!
Georg Haan (.NETherlands)
|
|
|
|