User Profile

Collapse

Profile Sidebar

Collapse
Matthew Page
Matthew Page
Last Activity: Dec 5 '07, 10:32 PM
Joined: Jul 11 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Matthew Page
    replied to Textbox update every frame?
    Well... The limit of the ontime function is 1 second, which doesn't really work for me. Googling for the OnTime function, however, led me to the Windows API calls for setting and stopping timers. This works great. Updating 10 times a second appears realtime, yet doesn't tax the system.

    Strangely, I can update the UI directly from the callback function that the timer uses, but I can't do it from a callback function from a COM object....
    See more | Go to post

    Leave a comment:


  • Matthew Page
    started a topic Textbox update every frame?

    Textbox update every frame?

    In VBA:

    Is there a way to get 'tie' a textbox to a variable such that every time the variable updates, the change is reflected in the textbox? If that isn't possible, then it would be acceptable to have a routine run every so often (100 ms, let's say) that would set the textbox to the variable.
    See more | Go to post

  • Passing messages to windows to get them to do something.

    I am trying to pass a message to a userform in VBA. I will include the code of what I have so far below. The problem I am having is that I don't know what I need to send in order to get the text I want to appear in the textfield that I want it to appear in.

    Here is the code...

    [code=vb]
    Private Const WM_SETTEXT As Long = &HC
    Private Declare Function FindWindow Lib "user32" Alias "FindWindow A"...
    See more | Go to post

  • Matthew Page
    started a topic Problem with thread updating UI thread

    Problem with thread updating UI thread

    I have a function callback from a C++ DLL which is being used in a VBA macro. The callback works fine when I just echo the parameters to the function to the screen using the MsgBox function. It fails, however, when I try to use the callback function to update the textboxes on the main userform. From research, I've determined that this is because a background thread cannot up date the UI thread. Even though the callback function is in the Forms...
    See more | Go to post

  • Matthew Page
    replied to COM DLL won't register
    in C
    Let me make it REALLY easy for you guys... It works. Problem solved. I was right about it being a bonehead beginner problem.

    Apparently, you can't mix DLL's compiled in Debug mode with other DLL's compiled in Release mode. I unintentionally did this when I neglected to name the debug DLL's differently than Release DLL's and put the directory with the Debug DLL's higher in the path than the Release DLL's.

    Interestingly...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to COM DLL won't register
    in C
    Wow... I guess we know which type of problem it is now... The kind no one here can help with...

    Given a days worth of troubleshooting this silly problem, I should break it into two problems.
    1) The DLL doesn't work when complied in Release mode. It compiles and registers without warnings or errors, but a program that references it just crashes.
    2) From within the COM DLL, if I reference a specific library, then the...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    started a topic COM DLL won't register
    in C

    COM DLL won't register

    I'm hoping that this is a bonehead problem. Much better to feel thick in the skull than to stump the experts and not have any help...

    Here are the relevant details of the problem. I have a COM DLL that is being called from Visual Basic. I have a function I want to implement. The function works fine except for one problem. It references a function from a library and prevents the DLL from registering. The COM DLL compiles without...
    See more | Go to post

  • Matthew Page
    replied to Counting memory
    in C
    You can get the size of the objects and then calculate how many it would take to reach your size limit. Then just stop when you reach that number. Or keep a running total in a variable and quit when you reach your limit. It's probably not exactly what you want to do, though......
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to Adding 2 polygons together
    in C
    Just a stab, but it looks like in some cases you are returning the data type and not a variable of the data type...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to COM and Polymorphism
    in C
    In the movie IQ, a smart but uneducated guy tries to pass himself off (with the help of Albert Einstein) as a super genius physicist to a very smart physicist girl. The guy asks Albert what to say if she asks him a question he can't answer. The response was something to the effect of "Just look thoughful and say, "Hmmm Interesting question." I didn't understand what he was trying to say. (Happens to me WAY to often...) So I put...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to COM and Polymorphism
    in C
    Ahhh yes... Interesting question... (Have you seen the movie IQ?)...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to Conditionally compiling C++ macros
    in C
    You might try adding another definition for FAULT in the else clause... That way in either case you get a definition for FAULT.
    See more | Go to post

    Leave a comment:


  • Matthew Page
    started a topic COM and Polymorphism
    in C

    COM and Polymorphism

    From what I've read, it isn't possible to have true polymorphism (well... function overloading...) using COM functions. I wanted to double check here to find out if there is a hack/work-around/bit-of-magic that can be done to mimic function overloading.

    If not, then I will just have to use different function names.
    See more | Go to post

  • Matthew Page
    replied to Define a string
    in C
    I don't know if it plays well in the C++ world, but for C you can use the sprintf function. The format would be the same as the printf function except that the first argument is the string you want to write to.
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to Using an STL vector in a struct with COM
    in C
    I hope you will indulge one last question on this thread. It's probably a bonehead question, but google was not my friend today.

    I have the array passing back and forth just fine. One problem I am having, however, is that on the VB side of the world, I have to create an array manually and assign it to the array in the data structure. Does this sound right to you?

    It would appear from the behavior that I am seeing...
    See more | Go to post

    Leave a comment:


  • First thing you should probably do is figure out the overall steps you would need to accomplish what they are asking. For example, get first number from user, check to see if it's valid, get second number... and so on. Don't worry about code until you get what you need to do figured out....
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to Using an STL vector in a struct with COM
    in C
    I should have asked, are there any really good COM/COM+/ATL books you would recommend that cover the versions of the above that correspond to VS 2005?

    In case you were curious... Passing a safe array seems to work fine. It's kinda ugly, in my opinion, but I don't know how to make it better. I'm declaring a structure in my idl file, putting a 'struct myDataType;' in the library section of the idl file, creating an instance of that...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to Using an STL vector in a struct with COM
    in C
    I am.



    Can't be irrelevant since this is where I'm having the problem.



    Have lots of functions available to VB. The one to return an object from the vector is the one that isn't working.



    COM object does appear in the VB Object browser. I'm pretty sure that I mentioned in my first or second post that I was able to interact with the vector, just not return...
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to while loop
    in C
    Along the same lines as the last post, you are incrementing i twice instead of once for each loop iteration.
    See more | Go to post

    Leave a comment:


  • Matthew Page
    replied to Using an STL vector in a struct with COM
    in C
    In reading the material, I had another idea I wanted to run by you... Would it be a simpler solution (though maybe not as elegant) to pass an array back and forth and dynamically create the vector when the array is passed from the VB routines to the COM DLL? It should be a one way street from VB to our API for this particular object... And I think that passing an array is much easier to do than this whole STL Vector mess. So does that sound like...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...