|
Use SHBrowseForFolder() . This article goes into more details.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a checkbox, and i want to change it's backgorund color. How do i do that?
|
|
|
|
|
This question appears so frequently that IMHO should be included in the FAQ.
Check Yuri Goltsam's article Colored/Blinking Controls and Dialogs with any Font for a particularly elegant solution.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi !
I'm developping a small SDI app with a CRicheditCtrlView.
a few questions :
1. How can I know that the embedded CRichEditCtrl is scrolling ?
I can handle clicks on scroll bars with VK_VSCROLL, handle page up /page down keys ....
Is there a way to detect scrolling without coding a method for each message ?
2. How can I calculate the number of text lines being deisplayed ?
Is there an equivalent for GetFirstVisibleLine() to find the last visible line ? If not, does someone know a method to achieve this ?
Thx
|
|
|
|
|
"1. I can handle clicks on scroll bars with VK_VSCROLL, handle page up /page down keys ....
Is there a way to detect scrolling without coding a method for each message ?"
Override OnHScroll and OnVScroll, these methods are called whenever horizontal or vertical scrolling happens.
"2. How can I calculate the number of text lines being deisplayed ?
Is there an equivalent for GetFirstVisibleLine() to find the last visible line ? If not, does someone know a method to achieve this ?"
I think you have to use GetFirstVisibleLine and then start adding line heights until you get to the window size and declare that your "last visisble line"
Hope this helps,
Bill
|
|
|
|
|
A while back I had been working on a mp3 player/organizer that used the XAudio engine for playback. I haven't touched it in a while and just recently I wanted to pick it back up, but the xaudio web site has been saying that they are down updating their site. I have been watching it for over a month and either they are very slow at updating or it may not be available for good. Does anyone know where I can download the XAudio SDK(I hope) or does anyone recommend a different solution.
Joshua
Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
If you look up skinnable app, all the code to play an mp3 via DirectSound is on this site.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hey!
What API functions should I use to set basic local network settings for Win95 / Win98? I want to be able to set the network settings to either DHCP or a specific IP, mask and gateway - in a similar way to the way you set it in the Control Panel.
Thanks!
Oz
|
|
|
|
|
Hi, all. Below is a program i wrote for test. it contains a class named CBase.
#include <stdio.h>
class CBase{
public:
virtual void VFunction()
{
printf("Hello, VFunction.\n");
}
int _a;
};
int main()
{
CBase obj;
int** ppv;
ppv = (int**)&obj;
void (*pFunc)();
// Now i want pFunc to be assigned to the value of **ppv,
// but it can't be like pFunc = **ppv, right?
return 0;
}
so, what can i do for that? Thanks.
|
|
|
|
|
What are you trying to test? The code doesn't make any sense. Once you do ppv = (int**)&obj; , nothing involving ppv will work right because &obj is not of type int** . The cast forces the assignment to compile, but trying to dereference ppv will cause all sorts of havoc.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
since ppv=(int**)&obj;, ppv point to the begin of obj object, cos' the obj contains a virtual function, it contains a virtual ptr(__vptr), and i'm using vc6, the microsoft complier set the vptr at the begin of the object, so ppv is pointed to the vptr when finishing the assignment.
The memory just like below:
----------
| vptr |
----------
|int _a |
----------
CBase obj;
(each column is 4 bytes)
|
|
|
|
|
I still don't understand what you're trying to test.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Michael Dunn wrote:
I still don't understand what you're trying to test.
You are not the only one Michael, you are not the only one.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
the main purpose of my program is to call the virtual function by using the ppv pointer. the ppv is the virtual pointer points to the virtual table, and the virtual table contains the address(es) of the virtual function(s) in the class, so the *ppv is pointed to the virtual table, and the **ppv[0] points to the first virtual function address, **ppv[1] points to the second virtual function address.
|
|
|
|
|
That's not how you call virtual functions. You use a pointer to a C++ object, and call methods thru that pointer.
class CBase
{
public:
virtual void VFunction()
{
printf("Hello, VFunction.\n");
}
int _a;
};
int main()
{
CBase obj, *pobj = &obj;
pobj->VFunction();
} However none of this makes a difference because without a hierarchy of derived classes, you're not using polymorphism, which is what virtual functions are for.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Thank you very much. i knew this way of calling the virtual function. but now i want to implement that by another way. and i know it really works. i just don't know how to do the last step -- if you got the function address, how to assign it to a function pointer, just like:
void* address; // or int* address;
void (*pFunc)();
...
pFunc = address; // address contains a function address. but pFunc cannot be assign like this expression.
|
|
|
|
|
Oh, OK, you just want a pointer to point at a member function.
class CBase
{
public:
void func()
{
printf("Hello, VFunction.\n");
}
};
int main()
{
CBase obj, *pobj = &obj;
void (CBase::*pBaseMethod)() = CBase::func;
obj.*pBaseMethod();
pobj->*pBaseMethod();
} The .* or ->* operator dereferences the function pointer.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Haaaa... thank you again. but what i really want to know is how the virtual pointer and the virtual function table work inside the class.(actually, virtual pointer is inside the class, virtual function table is not)
|
|
|
|
|
Dear All,
In my project i have to get the ClassId and ProgId for an ActiveXControl,Can any one help me how to search the registry for ClassID and ProgId through VC++ programme.
With special thanks
akshay
|
|
|
|
|
Use CLSIDFromProgID. In this case, the ProgID is the Name of the interface.
e.g.
[ccode]
CLSID ID;
CString strProgID = "Program.Interface";
HRESULT hr = CLSIDFromProgID( strProgID .AllocSysString(), &ID); // GUID is in ID if successful.
[/ccode]
Hope this helps,
Bill
|
|
|
|
|
Thank you for your idea,today i have an holiday i will check this code on monday,
sir,Is there any MFC class for Registry search.
Actually i have to write a function for getting ClassId and progId as like
Myfunction("c:\mycoment.ocx")
{
//this function will return ClassId and ProgId for
//corresponding ocx from registry
}
Please help me sir,because i didn't have much knowledge on registry search
once again thank you for your reply
|
|
|
|
|
Use the following API calls
(1) RegOpenKeyEx
(2) RegQueryValueEx
(3) RegEnumValue
(4) RegEnumKeyEx
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Thank you for your Sugesstion.
Is there any specific MFC class for Registry Search.
Thanks in advance
|
|
|
|
|
akshay wrote:
Is there any specific MFC class for Registry Search
Not that I am aware of.
Basically you'll need to enumerate all the keys and then enumerate all the values.
Even if you find a class, that's all what even the class would do for you.
I recommend Joe Newcomer's class if you dont want to do the enumerating and querying usign API
Here is the link
http://www.codeproject.com/system/registry_class.asp
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
I've check everywhere I can, but how do I generate a small floating text display when the mouse cursor rest for a while over the client area?
Just like when you rest the mouse cursor over a variable in VC++, its class or type is displayed in a small info box much like the tooltip.
|
|
|
|