|
Im looking for a good example to show me how to use a slider control. Ive some useful things through googling, but wondering if anyone knows of a good tutorial sorta thing. Some the questions im looking to get solved is, i have a vertical slider, and it increases as the thumb goes down, and i want that inveresed. The other is how to limit the interval of the thumb? I have set the range from 0 - 3000 and only want it in multiples of 50. Some others would be how to implement the VM_VSCROLL deal, im not quite sure how to do that. And on and on... Thanks in advance.
-Jader89
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Not so much graphically, but functionality
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Jader89 wrote: Im looking for a good example to show me how to use a slider control.
This would be a good place to start.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I've been there, doesnt help much on what i want to do. Unless im blind and missing a blantantly obvious method, among other things.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
You need to use the TBS_DOWNISLEFT style, although this style may just be ignored by the control.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I've tried that and TBS_REVERSED , all combonations of both and it still seems to not be working.. Here is the part in the .rc file. Any ideas why this doesnt work?
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS| TBS_VERT | TBS_TOP | TBS_ENABLESELRANGE | TBS_DOWNISLEFT | WS_GROUP | WS_TABSTOP | 0x400,207,23,21,116
Here is the OnInitDialog(), there is no other place i do anything with it.
BOOL CThisClass::OnInitDialog()<br />
{<br />
BOOL ret;<br />
ret = CDialog::OnInitDialog();<br />
<br />
altCtrl.SetRange(0, 3000);<br />
altCtrl.SetTicFreq(300);<br />
altCtrl.SetPos(3000);<br />
UpdateData(FALSE);<br />
<br />
return ret;<br />
}
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Jader89 wrote: Any ideas why this doesnt work?
Yes. Like I indicated, it may be one of those styles that the control ignores. I can neither confirm nor deny this, though.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi All,
Is there a way to know the reference to the calling function at runtime without using some flag variables? For eg.
<br />
void foo() {<br />
foobar();<br />
}<br />
<br />
void bar() {<br />
foobar();<br />
}<br />
<br />
void foobar() {<br />
<br />
if (calling function is 'foo') {<br />
bla... bla..<br />
} else {<br />
bla... bla..<br />
}<br />
}<br />
Thanks.
|
|
|
|
|
The only thing I can think of it to pass an argument to the foobar() function.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: The only thing I can think of it to pass an argument to the foobar() function.
Thanks David. But maybe I did not put my question correctly. I have a library and I want to hide a function from direct calling by functions which are external to the library. Kind of like keeping it in private: section of a C++ class. But the problem is, I want the library in pure C and not C++. So, my library function 'foo()' should be able to invoke foobar() correctly. However, if an external function bar() tries to invoke it, the library should be able to correctly identify it and return appropriate error.
Appreciate your help.
|
|
|
|
|
Even with these new constraints, my suggestion will still work. All you have to do is choose a number to pass to the exported foobar() function that will likely not be guessed by others.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Even with these new constraints, my suggestion will still work. All you have to do is choose a number to pass to the exported foobar() function that will likely not be guessed by others.
You are right. That is a Workable solution. Thanks David.
|
|
|
|
|
I'm not certain that you can hide functions in a library; hackers will find the name and arguments for it in the library ( but I might be wrong )
If the function is not "published" in a header file, a normal user will not call it.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: If the function is not "published" in a header file, a normal user will not call it.
I agree with you on that. Thanks Maximilien.
|
|
|
|
|
> a normal user will not call it.
Does that make me abnormal?
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Is it possible to store the images in one dll?
Here I would like to store some images into one dll.
And when ever I want I want to call them from that dll.
Is that possiable? Can anyone help me in this concept or any suggestion please.
Nice talking to you.
|
|
|
|
|
|
In your .rc file for the DLL project, add a line something like this for each image:
"MY_NAME" "IMAGES" "path\\to\\image.jpg" .
Then load the DLL dynamically by using HMODULE hModule = LoadLibraryEx("path\\to\\dll", NULL, LOAD_LIBRARY_AS_DATAFILE); (Skip last parameter if you intend to execute code from it as well).
Then from your application call:
HRSRC hRes = FindResource(hModule, _T("MY_NAME"), _T("IMAGES"));
HGLOBAL hGlob = LoadResource(hModule, hRes);
DWORD dwResSize = SizeofResource(hModule, hRes);
void* pData = LockResource(hGlob);
By this point, pData is pointing to a byte array, which contains the data from the jpg-file. It's length is dwResSize .
I omitted all the error checking for brevity.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
G Haranadh wrote: Is it possible to store the images in one dll?
what images ?
G Haranadh wrote: And when ever I want I want to call them from that dll.
Call them for what ?
Can you help us by telling us what you want to achieve ?
One way to store images in a DLL is to include them in a resource DLL ( hint hint wink wink )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Here we are trying to store some giff images in the dll.
And would like to display them when ever we want.
I mean the functionality like messenger. The animations can be apeared in those images. Our application target is this.
Thanks for your help.
Nice talking to you.
|
|
|
|
|
G Haranadh wrote: And would like to display them when ever we want.
I mean the functionality like messenger. The animations can be apeared in those images. Our application target is this.
Create a Resource Dll as Suggested By Mr Jorgen!.. and you can use CEnBitmap: Derived From CBitmap[^] class by Dan.g. to dynamic display them..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Here is an easy one for you experts....
How do I put a bitmap or an icon on a CButton control and include test as well.
what I need is to have the text "Open..." on the button with a small folder icon/bitmap on the left side.
Any naswers ?
Thanks in advance,
Shay
|
|
|
|
|
|
Unfortunately, that class doesn't handle XP themes, so it would look really ugly in an XP GUI.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Jörgen Sigvardsson wrote: so it would look really ugly in an XP GUI
doesn't everything?
i still use the 'classic' (Win98) style in XP.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|