Click here to Skip to main content
15,896,726 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SELECT * FROM - Tablename which has spaces Pin
Tara1411-Jul-06 20:43
Tara1411-Jul-06 20:43 
GeneralRe: SELECT * FROM - Tablename which has spaces Pin
Tara1411-Jul-06 20:50
Tara1411-Jul-06 20:50 
AnswerRe: SELECT * FROM - Tablename which has spaces Pin
toxcct11-Jul-06 21:14
toxcct11-Jul-06 21:14 
QuestionOwner Draw Pin
Try11-Jul-06 19:56
Try11-Jul-06 19:56 
AnswerRe: Owner Draw Pin
led mike11-Jul-06 20:11
led mike11-Jul-06 20:11 
GeneralRe: Owner Draw Pin
Code_Zombie11-Jul-06 20:25
Code_Zombie11-Jul-06 20:25 
AnswerRe: Owner Draw Pin
Hamid_RT11-Jul-06 23:10
Hamid_RT11-Jul-06 23:10 
QuestionProblem with STL Pin
Super Lloyd11-Jul-06 19:28
Super Lloyd11-Jul-06 19:28 
I'm trying a double indirect look-up table for some function pointer in my app (yep, I have good reason).
I'm trying to use std::map for the table but (because of the double indirection) I need to use a "std::map*"
Which I don't know how to map[index] (with a pointer)

Now perhaps I'm misusing it, I'm not sure (I know nothing of STL and I have some problem understanding its header)

Anyway here is my code (problem explained in red), if you could give me some tips.....
static std::map<const char*, SEL> map_sels;
static std::map<OClass, std::map<SEL, IMP>*> map_imps;

void id::GetImpAlways(const char* name, SEL& sel, IMP& imp)
{
    if( !_handle )
        throw gcnew ObjectDisposedException(Class()->Name);

    if(map_sels.find(name) == map_sels.end())
    {
        sel = sel_register_name(name);
        map_sels[name] = sel;
    }
    else
    {
        sel = map_sels[name];
    }

    std::map<SEL, IMP> * class_imps; <font color="red">// here I get the problematic "map *"</font>
    if(map_imps.find(_handle->class_pointer) == map_imps.end())
    {
        class_imps = new std::map<SEL, IMP>();
        map_imps[_handle->class_pointer] = class_imps;
    }
    else
    {
        class_imps = map_imps[_handle->class_pointer];
    }

    if(class_imps->find(sel) == class_imps->end())
    {
        imp = get_imp(_handle->class_pointer, sel);
        if( !imp )
            throw gcnew ObjectiveCException("No such method");
        class_imps[sel] = imp;  <font color="red">// can't do that with 'map*', what should I so?</font>
    }
    else
    {
        imp = class_imps[sel]; <font color="red">// can't do that with 'map*', what should I so?</font>
    }
}
<pre>

AnswerRe: Problem with STL Pin
Steve Echols11-Jul-06 19:40
Steve Echols11-Jul-06 19:40 
GeneralRe: Problem with STL [modified] Pin
Super Lloyd11-Jul-06 19:50
Super Lloyd11-Jul-06 19:50 
GeneralRe: Problem with STL Pin
Steve Echols11-Jul-06 20:48
Steve Echols11-Jul-06 20:48 
AnswerRe: Problem with STL Pin
Super Lloyd11-Jul-06 19:50
Super Lloyd11-Jul-06 19:50 
GeneralRe: Problem with STL [modified] Pin
Super Lloyd11-Jul-06 20:14
Super Lloyd11-Jul-06 20:14 
AnswerRe: Problem with STL [modified] Pin
Stephen Hewitt11-Jul-06 20:55
Stephen Hewitt11-Jul-06 20:55 
GeneralRe: Problem with STL Pin
Super Lloyd11-Jul-06 21:02
Super Lloyd11-Jul-06 21:02 
GeneralRe: Problem with STL Pin
Stephen Hewitt11-Jul-06 21:15
Stephen Hewitt11-Jul-06 21:15 
GeneralRe: Problem with STL Pin
Super Lloyd11-Jul-06 21:39
Super Lloyd11-Jul-06 21:39 
GeneralRe: Problem with STL Pin
Stephen Hewitt11-Jul-06 21:50
Stephen Hewitt11-Jul-06 21:50 
GeneralRe: Problem with STL Pin
Super Lloyd11-Jul-06 22:11
Super Lloyd11-Jul-06 22:11 
GeneralRe: Problem with STL Pin
Stephen Hewitt11-Jul-06 22:26
Stephen Hewitt11-Jul-06 22:26 
QuestionC2664 error.......in evc++4.0 Pin
cool_frozen11-Jul-06 17:54
cool_frozen11-Jul-06 17:54 
AnswerRe: C2664 error.......in evc++4.0 Pin
bob1697211-Jul-06 18:46
bob1697211-Jul-06 18:46 
GeneralRe: C2664 error.......in evc++4.0 [modified] Pin
bob1697217-Jul-06 19:56
bob1697217-Jul-06 19:56 
GeneralRe: C2664 error.......in evc++4.0 Pin
cool_frozen17-Jul-06 23:39
cool_frozen17-Jul-06 23:39 
AnswerRe: C2664 error.......in evc++4.0 Pin
led mike11-Jul-06 19:25
led mike11-Jul-06 19:25 

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.