How to access function from Top Class to Function of class that contain the the member variable of TopClass

Dear All,
is there any way that i can access function or member variable of aggregate class.
i am working in Visual Studio 2010 
and making win32 dll with mfc Support. i am new in dll system. just learning and doing.
previously all in exe and i am working this like
CTestDoc*pDoc = (CTestDoc*)GetTestDocument();
somevar = pDoc->xDoc.mVar.GetValue (); 
now i am trying to put all in dll. so getting problem 
will i get help on this. thanks in advance.
below code is just an example.
for example
// dll 1
class aaa : public BaseClass
public:
int Index;
char *cName;
void doSometing()
if (GetCurBColor() == 125) // how to access GetCurBColor function of the
color = GetCurBColor();
long color;
// dll 2
class bbb :public BaseClass
public:
int Index;
long lSize;
long color;
void doSometing();
// dll 3
class DDD
public:
vector <aaa> va;
vector <bbb> vb;
int cura;
int curb;
long GetCurBColor ()
return vb[curb].color;
};// MFC doc/view support
/// in exe in document
class inExe
public:
DDD d;
void addB()
{ bbb bb;
bb.color = 152;
d.vb.push_back(bb);
bb.color = 122;
d.vb.push_back(bb);
bb.color = 1232;
d.vb.push_back(bb);
d.curb = 1;
void addA()
{ aaa aa;
aa.color = 152;
d.va.push_back(aa);
aa.color = 1232;
d.va.push_back(aa);
aa.color = 1542;
d.va.push_back(aa);
aa.color = 15;
d.va.push_back(aa);
d.cura = 2;
d.va [1].doSometing ();

Dear All,
is there any way that i can access function or member variable of aggregate class.
i am working in Visual Studio 2010
and making win32 dll with mfc Support. i am new in dll system. just learning and doing.
previously all in exe and i am working this like
CTestDoc*pDoc = (CTestDoc*)GetTestDocument();
somevar = pDoc->xDoc.mVar.GetValue ();
now i am trying to put all in dll. so getting problem
What problem?
The rules of C++ do not change because some of the code ins in a DLL. But the classes in a DLL need to be exported. See for example
https://msdn.microsoft.com/en-us/library/81h27t8c.aspx
You should also supply a macro so that the class header can be used in both the DLL and the client. See for example
http://stackoverflow.com/questions/14980649/macro-for-dllexport-dllimport-switch
If  you exchange memory between the DLL and the client (as your example will do, because of the std::vector content), you should also be sure to use the same version of the compiler for each module, and to dynamically link to the CRT.
I would also advise you to start with a less complicated scenario, with just one DLL.
David Wilkinson | Visual C++ MVP

Similar Messages

  • How to access symbol from different stage

    Hi everyone,
    I'm really new at Edge, so I still have a lot to learn and I need your help with something..
    I want to know how to access a symbol from another stage, here's what I've and what I want to do..
    I've the main index page with symbol named "content", in content I load other composition (page). called "page2".
    all I want to do is when I click a symbol "XX" inside "page2". The "content" symbol loads other composition called "page3".
    I don't know how to access "Content" from "page2", so I could load "page3" ..  that's it
    I feel like it's simple, but I just couldn't know how to do it, I',m sorry for bothering you for such a question, but I've searched a lot and I got nothing.
    Thanks
    I thought I could use something like this
    var comp = Edge.getComposition("EDGE-638329");  
    var stage = comp.getStage(); 
    var symp= comp.stage.getSymbol("content");
    EC.loadComposition("assets/units/stage1/s1_3/s1_3.html",symp);
    but it's still not working, could someone please tell me what I'm doing wrong?

    I have multiple compositions, where I need to go from one to another.
    I use click scripts in an element to do this, using identical pages with different animations on each page.:
    Click script:
    AdobeEdge.goLoc(url); //url is the URL of an identical new html page with a different animation
    Then I have a custom .js page that I use that has the function:
    AdobeEdge.goLoc = function(url) {
    location=url;
    Peter Small

  • Accessing Objects from a Class

    Hello,
    I have a process that calls a method from a class, at runtime, the object creates a reference and in the reference I need to access an object, basically this is what I have at run time:
    Object: WA_OBJECT
    Reference:
    If I double click on my object I get the following sub objects:
    CL_PT_REQ_HEADER
       IF_PT_REQ_HEADER~CURRENT_VERSION
       IF_PT_REQ_HEADER~MAX_VERSION_NO
       IF_PT_REQ_HEADER~MY_REQUEST
       ITEM_TAB
    if I double click on any of those items, it is fine in debugging, I can see the values, but in my program, I need to access the ITEM_TAB internal table, now I cannot use WA_OBJECT-ITEM_TAB. If I double click on the ITEM_TAB, now the main object becomes -ITEM_TAB[1], so cannot reference to that object in my program, so the question is how do I access the table?
    Thanks for any answers.

    Hello Enrique
    ITEM_TAB is a <i>public </i>instance attribute of class CL_PT_REQ_HEADER. Thus, you can directly access them using
    DATA:
      ls_item    TYPE PTREQ_ITEMS_STRUC,
      lo_item    TYPE IF_PT_REQ_ITEM.
      LOOP AT wa_object->item_tab INTO ls_item.
        lo_item = ls_item-item.
      ENDLOOP.
    Regards
      Uwe

  • From my iPad I can print wirelessly in my office, but how do I print remotely via the web through my HP ePrint printer.  It is set up with an email address but i don't know how to access it from my iPad.

    I can print wirelessly in my office from my iPad, but how do I print remotely via the web to my HP ePrint printer.  The printer is set up with an email access address but I don't know how to access it from my iPad.

    Read through this for some information on how to do this:
    http://www8.hp.com/us/en/support-topics/mobile-printing/how-to-print-mobile-devi ces-ipad-iphone.html

  • Accessing the ServletContext from a class that is not a Servlet?

    Is there any way of accessing the ServletContext from a class that is not a
              Servlet? The class is being used as part of a Web Application.
              Thanks.
              

    http://www.mozilla.org/mirrors.html
    Mozilla has download mirrors around the globe. If it is on the list, it is trustworthy.

  • How do i switch from top sites view to normal view

    how do i switch from top sites view to normal view

    Visit the site you want it to be the Homepage.
    Safari > Preferences > General
    Homepage:
    Click the "Set to Current Page" button.
    New windows open with:
    Click the popup menu box and select "Homepage"
    New tabs open with:
    Click the popup menu box and select "Homepage"
    http://support.apple.com/kb/PH11857

  • I created a folder from my camera roll and shared with my icloud acct, can't figure out how to access it from my computer?

    I created a folder from my camera roll and shared with my icloud acct, can't figure out how to access it from my computer? I log onto icloud and can't find anywhere where "shared" photos are..

    You need Mountain Lion (10.8.2 or higher) and iPhoto '11 (9.4 or higher) or Aperture 3.4 to get shared photo streams on Mac.
    Another option to transfer them is to either import them to iPhoto using your usb cable, as explained here:http://support.apple.com/kb/HT4083, or to us an app like PhotoSync to transfer them to your Mac over your wifi.  (PhotoSync will also transfer albums, not just photos from the camera roll.)

  • Help and some explanation how to get a Microsoft.Office.Tools.Excel.Worksheet host item that extends the functionality of the current Microsoft.Office.Interop.Excel.Worksheet object

    Hello,
    I would use some help and more info about how to get host object that extends the functionality of my current Interop.Excel.Worksheet object. I read this artical: https://msdn.microsoft.com/en-us/library/ee794671.aspx where I can call this function
    GetVstoObject to get host object. But I see that here I need to pass the Globals.Factory object as second parametar. Can someone give me more details about that parameter and how to access it? I would like to get host object so I can access extension
    property, since my interop excel worksheet doesn't have it.  
    I am using Visual Studio 2013 for developing Excel addin. Using Excel 2010.
    Thanks in advance for help.
    Regards,
    Zeljka

    Hi Zeljka,
    >>I am using the Microsoft Office PIAs, so my question is how to access this automatic generated class Globals in my case?   <<
    Sorry, I am not able to understand the application you were developing exactly. From the orgnal post, you were developing an application level add-in, however based on the description above, it seems that you were building an console or Windows form application
    to automate Office application.
    If you were developing Office automation, the host item can't work for this secnario since it should run under the VSTO runtime.
    If I misunderstood, please feel free to let me know.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to access an old account to update apps purchased with that account?

    How to access an old account to update apps purchased with that account?
    I cannot update purchased apps in iphone/itunes because I cannot enter the password for the old account. It does not exist anymore anyway.

    Restore from your backup of old computer.
    You can redownload past purchases.
    -> iTunes: Download past purchases
    FYI: Lab top is a roof over a science room.
    A laptop is a computer that sets on top of your lap...

  • How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    Please advise...
    VJ

    cross posted
    http://forum.java.sun.com/thread.jsp?thread=299137&forum=31&message=1184025

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • How to sent text from my C# WinForm program to another program - where the cursore is

    hi
    how to sent text from my C# WinForm program to another program - where the cursore is
    for example: i have in my program label that contain "ABC" , when i press 'Z'
    the ABC will Appears where the cursore is standing.
    how to do it ?
    what to look for ?
    thanks

    Hi E_Gold,
    You'll need to:
    1) Bring the app to the front
    2) SendKeys to the app
    This code will send "ABC" to MS Word:
    using System.Runtime.InteropServices;
    private void Form1_Load(object sender, EventArgs e)
    // Send the keys 'ABC' to MS Word:
    SendKeysToApp("word", "ABC");
    private void SendKeysToApp(string appName, string keys)
    if (BringAppToFront(appName))
    SendKeys.Send(keys);
    [DllImport("User32.dll")]
    private static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab);
    private bool BringAppToFront(string processName)
    IntPtr hWnd = HWnd(processName);
    if (hWnd != new IntPtr(0))
    SwitchToThisWindow(hWnd, true);
    return true;
    else
    return false;
    private IntPtr HWnd(string processName)
    IntPtr hwnd = new IntPtr(0);
    using (Process process = ProcessGet(processName))
    if (process != null)
    try
    IntPtr h = process.MainWindowHandle;
    hwnd = h;
    catch
    if (hwnd != new IntPtr(0))
    return hwnd;
    return hwnd;
    public Process ProcessGet(string processNameToGet)
    if (processNameToGet == "")
    return null;
    Process[] processes = Process.GetProcesses();
    foreach (Process process in processes)
    if (process.ProcessName.IndexOf(processNameToGet, StringComparison.CurrentCultureIgnoreCase) != -1)
    return process;
    return null;
    For info on sending special keys such as "Enter", so this page on MS website:
    SendKeys Class
    Hope this helps.
    Thanks, Andy

  • Controlling MovieClip properties from a Class that it's linked to

    Hi all,
    I have a Moveclip with a Dynamic text field instance name of
    "optionName". The movie clip is linked to my custom Class "Toggle".
    Is there a way for me to access "optionName" from my class?
    Basically I am getting this error:
    Thanks.

    Thanks, much appreciated.

  • In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    Sorry, I tried to say your answer solved my question, but I guess I told it that my response to you solved it. Now that I liked it, the solved option doesn't appear.

  • How to email text from a text component in my applet on a the host server ?

    How to email text from a text component in my applet on a the host server, back to my email address ?
    Assuming I have Email Form on the host server.
    Help will be appreciated.

    You can do like below
    =REPLACE(Fields!Column.Value," " & Parameters!ParameterName.value & " ","<b>" & Parameters!ParameterName.value & "</b>")
    The select the expression and  right click and choose placeholder properties
    Inside that set Markup type as HTML 
    then it will highlight the passed parameter value in bold within the full xml string
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for