none
tab index issue when using C# DllInvoke VC++ dll RRS feed

  • Question

  • Dear Experts,

    I have a VC++ program, I can use tab key to switch mouse focus of textbox.

    I recompile it to a dll file.

    And then, I create a C# solution, and use DllInvoke to invoke function of the dll file.

    DllInvoke _DllInvoke = new DllInvoke(System.Environment.CurrentDirectory + @"\MyDll.dll");
    RunProgDelegate RunProgDelegate = (RunProgDelegate)_DllInvoke.Invoke("ShowDialog", typeof(RunProgDelegate));
    IntPtr DllHandle = RunProgDelegate();
    // Put it into this form
    SetParent(DllHandle, this.panel1.Handle);

    I embedded it to a pabel.
    But I cannot use tab key to switch mouse focus of textbox.

    Am I do something wrong?
    Or missing something?

    Thank you.

    • Moved by Mike FengModerator Monday, December 3, 2012 7:46 AM (From:.NET Platform Architecture Development Discussions)
    Monday, December 3, 2012 3:51 AM

Answers

  • Dear Experts,

    I did some tests yesterday.

    I found if I build the VC++ as "Windows Form Control" project.

    Then, add this control into other C# windows form project.

    The tab key is working at this situation.

    Does this mean I should build my VC++ project as "Windows Form Control" to make tab key switch function enable?

    Any document or guild can be referenced?

    Thank you very much.
    Best Regards,
    Phenomt

    Friday, December 7, 2012 1:48 AM

All replies

  • Hi Phenomt,

    This sounds it doesn't make sense.

    Would you like to upload your whole test project?

    Upload it to skydrive and post the download link here.

    Have a nice day.


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Monday, December 3, 2012 9:41 AM
  • Hi Ghost,

    I have upload my test project to skydrive.

    https://skydrive.live.com/#cid=991856D524BAE8AF&id=991856D524BAE8AF%21239

    It's file name is TabIndex.zip

    Thank you very much.

    Best Regards,
    Phenomt

    Tuesday, December 4, 2012 3:19 AM
  • got it.


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Tuesday, December 4, 2012 9:27 AM
  • Hi Phenomt,

    I have download your sample and reproduced your scenario.

    Now, I will try to involve some other one into this case, please wait it patiently.

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, December 4, 2012 9:27 AM
    Moderator
  • Dear Experts,

    I did some tests yesterday.

    I found if I build the VC++ as "Windows Form Control" project.

    Then, add this control into other C# windows form project.

    The tab key is working at this situation.

    Does this mean I should build my VC++ project as "Windows Form Control" to make tab key switch function enable?

    Any document or guild can be referenced?

    Thank you very much.
    Best Regards,
    Phenomt

    Friday, December 7, 2012 1:48 AM
  • Hi Phenomt,

    First of all, thank you for posting your solution here.

    I am checking the document now, when I find it, I will post it here as soon as possible.

    Thank you for your understanding and support.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, December 18, 2012 12:28 PM
    Moderator