|
Hi,
I have problem with Picture control in my project. I am using 3 dialogs. When I put Picture control on my dialog and set properties: Type to Icon, Image is icon ID from resource so I see icon icon in the Picture control - everything looks ok.
But when I build the program so I see different icon in the Picture control - I see a cursor icon(white arrow with question mark) instead of my icon from resource.
This is definition of Picture control from my resource:
ICON IDI_ICON2,IDC_STATIC_ICON,181,154,20,20,0
The value of IDI_ICON2 is 112
I tried create a new project with one dialog box. It was working without any problems.
What am I doing wrong.
Thanks.
|
|
|
|
|
No idea what could be wrong there but did you try changing the value of IDI_ICON2 from 112 to something else, for example to 1000?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
thanks for reply.
When I changed the value to 2000 so I see nothing. There is no icon.
|
|
|
|
|
Clean and rebuild your project and see if anything changes.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I cleaned the solution and rebuilt that againt - It's same - I see nothing.
|
|
|
|
|
I see...did you maybe -by mistake- add your icon as cursor resource instead of icon resource, or maybe selected cursor -if possible- instead of icon for the picture control? Does the arrow with questionmark cursor thing appear again if you change the ID back to 112? I did some look around and 112 seems to be the resource ID of the standard "arrow with questionmark" mouse cursor, so my guess is that someone somewhere loads a cursor instead of an icon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
modified on Saturday, February 28, 2009 2:39 PM
|
|
|
|
|
I checked it all over again - when I change the value to 2000 I see nothing, to 113 I se different cursor(pen).
In the type properties there is value Icon. There are no curors in the my resource. I see the icon in the Icon folder in the Resource viewer(there are no cursors).
|
|
|
|
|
Well, if you don't mind the workaround, i suggest setting the icon from code using CStatic::SetIcon[^] instead of using the resource...that should help, just use LoadIcon[^] or CWinApp::LoadIcon[^] and then set this to your static control. Don't forget to use DestroyIcon[^] once you are done with it. Your dialog's OnInitDialog[^] is a good place for setting the icon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
modified on Saturday, February 28, 2009 3:34 PM
|
|
|
|
|
SendDlgItemMessage(hDlg,IDC_LOGO, STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM) LoadIcon(ghInstance,MAKEINTRESOURCE(IDI_ICON1)));
I see nothing;
GetLasterror returns - The specified resource type cannot be found in the image file.
But this icon - IDI_ICON1 is there because I use it as icon for exe file and for title bar.
I am giving up.
Thanks for you time.
|
|
|
|
|
I am a Novice at c++, and was wondering if anyone knew how to make a program that would count by multiples of 10, and could count up to very large numbers, ex: 500 digits.
|
|
|
|
|
You'll want a 'BigNum' library, like this one[^]. Then your program is as simple as this:
#include <iostream>
#include <gmpxx.h>
int main(int, char**)
{
mpz_class num(10);
while (1)
{
std::cout << num << std::endl;
num += 10;
}
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All,
I am using a 3rd party dll when i am debuging this dll i am facing a problem the problem is it is skiping the function for example if
there are function in dll suppose
A(); // I WANT TO GET IN TO DEBUG A
B();
But dont know how it is getting in to B.
i am using VS2008 with MFC Feature Pack.
Thanks for any idea or suggestion.
|
|
|
|
|
Unless the dll is supplied with debugging symbols, and you have the source code, the answer is tough. C++ code gets compiled, and ulness you're amazing with assembler, that's largely it.
So, ask the supplier of the 3rd party dll very nicely.
I'm not 100% sure I've understood your question properly though, so feel free to explain it more.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
Thanks for your response.
you are correct i am having source code of dll as well with me actually the problem is very dramatic i am inherting a control class in my project and then creating its object then it is not properly working, if i directly create the object of the baseclass then it is working fine for me but if i create the object of my derived class then it is not working for me.... the sample is below
void SEC_TREECLASS::ParseCreateStruct(CREATESTRUCT& cs)
{
DWORD dwTreeStyle = cs.style & TVS_STYLES;
cs.style &= ~TVS_STYLES;
DWORD dwTreeExStyle = cs.dwExStyle & TVXS_STYLES;
cs.dwExStyle &= ~TVXS_STYLES;
// THIS IS THE PROBLEM POINT I WANT TO GET IN TO THIS METHOD BUT
ModifyTreeCtrlStyle( 0, dwTreeStyle, FALSE );
// IT IS JUMPING INSIDE THIS
ModifyTreeCtrlStyleEx( 0, dwTreeExStyle, FALSE );
}
IF I am creating the same thing in sample code then derived class is also working for me ..... i know it is tough to answer because situation is not consistent ....just if some one have faced this problem ever give some suggestion.
|
|
|
|
|
If the dll has debuging symbols you should be able to step into it. And VS will ask you where the source code is. It may be you have a non debug version if that is the case you will need to rebuild the dll from source with symbols.
a programmer traped in a thugs body
|
|
|
|
|
I have the same problem with the same method in BOOL SEC_TREECLASS::ModifyTreeCtrlStyleEx
inside, the first line is
DWORD dwTreeStyleEx = GetTreeCtrlStyleEx();
but it jumps into SetTreeCtrlStyleEx()
How did you manage to overcome your problem?
|
|
|
|
|
It works now.
Stingray should be compiled as MFC Dll Stingray dll and project settings should indicate that these libraries should be used.
Something like _SFLDLL, _OVDLL.... in preprocessor definition should be put
|
|
|
|
|
|
I use
vector<string> to save a huge file
Each item maybe a word or a sentence
but
vector<string> cost too many memory
eg:
20M file cost 200M+ memory
How can I reduce memory using???
Thanks
Techie York
|
|
|
|
|
How about holding the file in a buffer then storing pointers to word beginning & end in the vector:
char* fileBuffer = new char[fileSize];
typedef std::pair<const const=""> Word;
std::vector<word> words;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
bcoide
Thank you for your share
but I deal with different language
Full Text Search
The vector saves the result of segment
so use string is convinient
but vector's memory grows so fast and huge
a 20M file's result can cost 200M memory
that a waste!!
thank you
maybe I need another idea!
|
|
|
|
|
It's like this
vec[0] = "you";
vec[1] = "friend";
vec[2] = "你好";
vec[3] = "朋友";
I use
vector<string> to hold word and build index to search
If I save pointer
The speed of building index maybe not so fast
because I deal with Chinese and English together
I have to consider the speed
but the cost of memory is so big
I wanna find a way on balance
Thank you so much
|
|
|
|
|
If you had
wchar_t fileBuffer[] = "youfriend你好朋友";
You could have:
typedef std::pair<wchar_t*,> Word;
std::vector<word> words;
words.push_back(std::make_pair(fileBuffer, fileBuffer+3);
words.push_back(std::make_pair(fileBuffer+3, fileBuffer+9);
words.push_back(std::make_pair(fileBuffer+9, fileBuffer+11);
words.push_back(std::make_pair(fileBuffer+11, fileBuffer+13); ?
That could be less overhead than std::string, possibly.
Alternatively, you could use something like a trie[^] to hold all the words?
What's the intent, anyway - why are you building this list of words?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am doing a program about Full Text Search
English is easy to segment
but Chinese is complicated
First I should separate text that to make Chinese and English text to two vector
Second do segment to each text and building index for search
I have to consider about speed ,the size of index file and Search speed
some difficulty I've already solved
I wanna do it well
Thank you so much
|
|
|
|