CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: couling

Page 1 of 7 1 2 3 4

Search: Search took 0.23 seconds.

  1. Replies
    5
    Views
    1,878

    Re: Object's methods

    Hmmm. I tend to find the uses of integer Semaphores are a little different to those of boolean semaphores. But yes I did neglected to be specific about which type I was referring to.

    Also Java 1.5...
  2. Re: Can you discover at runtime what class is?

    Yes that's pretty much confirmed what I thought.

    I'm building a program with a plug-in architecture. Based on a configuration it will load objects of various classes named in a config file. ...
  3. Can you discover at runtime what class is?

    I think I already know the answer to this is "it can't be done" but I need to ask first before giving up and trying something different.

    I've got some code which I'm writing with generics. ...
  4. Replies
    5
    Views
    1,878

    Re: Object's methods

    I can't give a good answer to 1 but I can answer 2 for you a little.

    Simply being related to threading does not mean that the concept fits well into the thread class. For one thing, how would...
  5. Replies
    7
    Views
    1,009

    Re: Using exceptions in the real world.

    I've used the first method a fair bit while working with delphi classes as these can't be created on the stack. It never seemd the most elagent solution though.

    I only mentioned the second method...
  6. Replies
    7
    Views
    1,009

    Using exceptions in the real world.

    In most of the commertial programming I've done, I rarely have uses for exceptions because of issues with interfacing them with other (non-c++) code. When I have used them I've tended to follow the...
  7. Replies
    8
    Views
    2,417

    Re: integer type, still machine dependent?

    This discussion came up a few days ago. http://www.codeguru.com/forum/showthread.php?t=488068

    The general upshot is that all types are machine dependent in size. The order of sizes is strictly...
  8. Replies
    1
    Views
    706

    Re: Using pipes running apps

    Command line programs which wait for the enter key are just waiting for the newline charicter "\n". You should be able to simply write that charicter to the pipe.
    fputc('\n', cmd_pipe);Notice the...
  9. Replies
    7
    Views
    3,114

    Re: print it only if it is not a duplicate

    Light weight. :p
    But seriously when you feel like that, get some sleep and start again in the morning. The longer you stay awake unable to work the more time you waste.

    Okay, not sure what the...
  10. Replies
    2
    Views
    3,106

    Re: Segmentation Fault (sometimes)

    I'm going to assume that your code is deterministic (no random numbers no threading) and should in theory be the same every time.

    If its crashing some times and not others this can be caused by...
  11. Replies
    2
    Views
    10,034

    Re: Segmentation Fault inside recursive functions

    It appears you're new to programming forums in general. Code tags and correct tabbing go a long way.

    Okay the "segmentation fault" is misleading. The error text says "Stack Overflow". This is...
  12. Replies
    7
    Views
    3,114

    Re: print it only if it is not a duplicate

    It's doing this because each time round the "for" loop (checking for duplicates) it writes the number in the index its on.

    So lets say the population array was set to:1,5,3 and you had the random...
  13. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    Most compiler suits come with a program to automatically generate .lib files from the dll (This is called "implib" under borland). With some compilers such as MinGW you can pass the Dll in as a...
  14. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    Apologies for my mis information guys. Seems that using Dynamic load DLLs with borland is pretty much foo-bared up. Just I was unlucky to get ~10 tests that ran fine, the only feature obveously...
  15. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    Hmm, for some reason I read it as being inline rather than as a pointer to the vtable. Not sure what I was drinking to make me see that :sick:. That kinda makes my last two posts make a lot less...
  16. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    You missed my point.

    The plain C isn't a hack. Its just plain old callback functions as they existed before the days of OO. Its explicit and doesnt rely on the specific compiler to make it...
  17. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    You've sort of undone your own statement there by demonstrating that not all COM programs use virtual functions. The fact that some do is a hack in the compiler. A reasonably elagent hack I'll...
  18. Thread: A Question

    by couling
    Replies
    2
    Views
    592

    Re: A Question

    Huh? Processors, When adding or subtracting should remain correct past the wrap around. They have a "carry" flag to idicate that this has happened allowing a 32bit processor to be used to add or...
  19. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    As far as I can see, there's no reason for it to crash in the first place, just Borland doing something weird.

    It makes sense for linking in the dll's lib file to have a difference because I found...
  20. Replies
    3
    Views
    619

    Re: help making MakeFile

    Again you're making it unessarily complicated
    Taken from your first post, a file just containing the following would be sufficient to build your program:
    sample: p4a.c p4b.c
    gcc -o sample...
  21. Replies
    15
    Views
    2,102

    Re: Hex Conversion? (HELP PLEASE!)

    A string is just a sequence of numbers. They only become charicters when you try to display them to a user.

    You mentioned that you need to put these into a c++ file and you're right to realise...
  22. Replies
    3
    Views
    619

    Re: help making MakeFile

    Evidently not.

    Who did you copy that one off? Whoever it was your teacher will know it was copied too. Best to start your own from scratch and only put stuff in it that you understand.

    A quick...
  23. Replies
    15
    Views
    2,102

    Re: Hex Conversion? (HELP PLEASE!)

    Well converting to hex isnt too hard:
    Just read in 1,2,3 or 4 bytes at a time and use the itoa() function to do the conversion for you.

    In terms of putting it into a c++ file, why not just quote...
  24. Replies
    5
    Views
    817

    Re: Easier accessing of objects

    C++ offers no way to enumerate members of an object in the way that a language such as Actionscript or PHP does. Such things are really limated to the scripting languages where objects are...
  25. Replies
    36
    Views
    10,334

    Re: problem with freeing memory in dll

    Ah I see. That raises a number of issues.

    Options for libraries:

    Keep the source in a folder and just add it every project
    The easiest option, but it does increses build time and isn't the...
Results 1 to 25 of 161
Page 1 of 7 1 2 3 4





Click Here to Expand Forum to Full Width

Featured