Click here to Skip to main content
15,898,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC++ MFC questions Pin
henry00115-Jun-04 5:51
henry00115-Jun-04 5:51 
GeneralRe: VC++ MFC questions Pin
toxcct15-Jun-04 5:52
toxcct15-Jun-04 5:52 
GeneralRe: VC++ MFC questions Pin
henry00115-Jun-04 5:56
henry00115-Jun-04 5:56 
QuestionHow to overload [] and = for bit assignment Pin
ICantChangeMyAcct14-Jun-04 15:48
ICantChangeMyAcct14-Jun-04 15:48 
AnswerRe: How to overload [] and = for bit assignment Pin
Michael Dunn14-Jun-04 20:28
sitebuilderMichael Dunn14-Jun-04 20:28 
QuestionCan I use Shell Extentions? Pin
ngocdq14-Jun-04 15:16
ngocdq14-Jun-04 15:16 
AnswerRe: Can I use Shell Extentions? Pin
Iain Clarke, Warrior Programmer14-Jun-04 23:44
Iain Clarke, Warrior Programmer14-Jun-04 23:44 
GeneralC++ question. Pin
WREY14-Jun-04 14:37
WREY14-Jun-04 14:37 
I created a structure inside a function definition (which means that the structure will be destroyed when I leave that function scope). While I'm inside that function however, I would like to activate another function (let's call it 'DoSomethingWithStruct') to handle certain activities on that newly created structure.

In the class definition, I am able to get away declaring 'DoSomethingWithStruct' by using a 'void*' as the parameter to pass data between one function and the other.

My problem is, "How do I cast the 'void*' back to the structure when I'm inside 'DoSomethingWithStruct'? (Here's some code.)

class MyClass
{
...
void DoSomethingWithStruct(void* pMyStructure);
};

===============================

void MyClass::FirstFn()
{
struct MyStruct {...};
...
DoSomethingWithStruct(pMyStruct);
...
};

================================

void MyClass::DoSomethingWithStruct(void* pMyStructure)
{
// Here is where I need to cast 'pMyStructure' back from a 'void', to a 'MyStruct' type.
}

================================

I DO NOT want to declare 'MyStruct' as global.

Thanks for any insight.

Smile | :)

William

Fortes in fide et opere!
GeneralRe: C++ question. Pin
palbano14-Jun-04 15:18
palbano14-Jun-04 15:18 
GeneralRe: C++ question. Pin
WREY14-Jun-04 18:02
WREY14-Jun-04 18:02 
GeneralRe: C++ question. Pin
Indrawati14-Jun-04 16:37
Indrawati14-Jun-04 16:37 
GeneralRe: C++ question. Pin
WREY14-Jun-04 18:07
WREY14-Jun-04 18:07 
GeneralRe: C++ question. Pin
Indrawati14-Jun-04 18:46
Indrawati14-Jun-04 18:46 
GeneralRe: C++ question. Pin
WREY14-Jun-04 23:39
WREY14-Jun-04 23:39 
GeneralRe: C++ question. Pin
Michael Dunn14-Jun-04 20:31
sitebuilderMichael Dunn14-Jun-04 20:31 
GeneralRe: C++ question. Pin
WREY14-Jun-04 23:50
WREY14-Jun-04 23:50 
GeneralRe: C++ question. Pin
toxcct15-Jun-04 1:13
toxcct15-Jun-04 1:13 
GeneralRe: C++ question. Pin
WREY15-Jun-04 3:16
WREY15-Jun-04 3:16 
GeneralRe: C++ question. Pin
toxcct15-Jun-04 3:24
toxcct15-Jun-04 3:24 
GeneralRe: C++ question. Pin
toxcct14-Jun-04 22:15
toxcct14-Jun-04 22:15 
GeneralRe: C++ question. Pin
bikram singh15-Jun-04 6:50
bikram singh15-Jun-04 6:50 
GeneralRe: C++ question. Pin
toxcct15-Jun-04 8:28
toxcct15-Jun-04 8:28 
GeneralRe: C++ question. Pin
bikram singh15-Jun-04 10:51
bikram singh15-Jun-04 10:51 
GeneralAbout ‘HIWORD’ macro Pin
myfapb14-Jun-04 14:10
myfapb14-Jun-04 14:10 
GeneralRe: About ‘HIWORD’ macro Pin
palbano14-Jun-04 17:07
palbano14-Jun-04 17:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.