User Profile

Collapse

Profile Sidebar

Collapse
Omega
Omega
Last Activity: Jun 27 '08, 09:19 AM
Joined: Oct 10 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Omega
    replied to saving external variables in a class
    By the way, adding

    Code:
    else dummy = 3;
    trace(dummy);
    between line 17 and 18. Results in the following trace:

    Code:
    undefined
    2
    In other words, it appears that the second trace is executed before the first. (???).
    See more | Go to post

    Leave a comment:


  • Omega
    started a topic saving external variables in a class

    saving external variables in a class

    Hello,

    For my flash project I want to read variables from a text file and store them locally in flash variables. This workes fine if I put everything directly inside the flash project file (actions belonging to a certain frame). Because I need to write a lot of code I want to put it all inside an external actionscript file / class(es).
    When I define a variable (like 'dummy' in the example below) and copy a value read from a...
    See more | Go to post

  • Omega
    replied to reusing sockets
    in C
    Thanks for your offer, but it is not necessary to fix the code. I only need to mention this issue as a recommendation in a report. Therefore I needed a confirmation that this can indeed improve the written software (it already works, but quite slow). Thanks!...
    See more | Go to post

    Leave a comment:


  • Omega
    replied to reusing sockets
    in C
    Okay, but then you send a larger message in parts and after that you receive a message in parts. But what I want is to send a small message, receive an answer and then send a new message, receive an answer etc. I tried this but it doesn't work for me. I seems that the server closes that particular socket connection after 1 reply.
    See more | Go to post

    Leave a comment:


  • Omega
    started a topic reusing sockets
    in C

    reusing sockets

    Hello,

    I've a quite simple question about socket programming (but I can't find the answer in widely available sources). Is it possible to 'reuse' a socket within 1 connection? In other words, is it possible to place 'send()' and 'recv()' in a loop in the code below? In that case time will be saved because the socket doesn't have to be opened and closed for every new buffer. The socket desciptor stays the same, the only thing that has...
    See more | Go to post

  • Omega
    started a topic time consumption by creating/destroying threads
    in C

    time consumption by creating/destroying threads

    Hi,

    I'm a student working on a report about a piece of software (C++, linux) that I've written. The major tasks that this software executes are:
    >create a string based on called function (just a couple of integers converted to 'chars')
    >open a thread (using pthread_create)
    - main thread: start (deadlock) timer
    - new thread: execute client functions for (wireless) communication (send string to server)...
    See more | Go to post

  • Omega
    started a topic Edit control box in MVC++
    in C

    Edit control box in MVC++

    Hello,

    I want to create a simple dialog based interface for a program in MS Visual Studio (6.0) . On startup, the user should enter his/her name in a 'edit control box'. Now I created a button that captures the name (CString) from that box, but when the user presses 'enter' instead of pressing the button, the interface shuts down. I also want to capture the string when the user presses 'enter'.

    It shouldn't be that...
    See more | Go to post

  • Omega
    replied to pointer to pointer
    in C
    It might be wrong, but the easiest way. ;)

    I guess I have to get used to the way of writing c++ (indeed, I have more experience with C). But I managed to find a reasonable solution to my problem based on the first solution of getValue() in ClassB. (Every class in the series calls the following by a function and parameters).

    Thanks everybody!

    One more question that has to do with memory allocation;...
    See more | Go to post

    Leave a comment:


  • Omega
    replied to pointer to pointer
    in C
    By the way, the reason that I want direct access to ClassC is that it is a kind of database structure from where I want to pick attributes. It's a bit more complex than the given example, since there is also a ClassD (and maybe more).
    If I use the 'getValue' function I would have the same problem with lowel level classes (that also have their attributes). So I'd rather want to use something like

    ClassB->ClassC[3]->Cla...
    See more | Go to post

    Leave a comment:


  • Omega
    replied to pointer to pointer
    in C
    Okay, I see the problem (thanks). I didn't see it immediately because I use a graphical environment (Rhapsody) where a lot of code is generated.

    The problem isn't completely solved however, because the compiler doesn't know about the instance of ClassC when I call itsClassB->itsClassC[0]->getValue(); from ClassA:

    error: use of undefined type 'ClassC'

    That is caused by the fact that I only declare...
    See more | Go to post

    Leave a comment:


  • Omega
    replied to pointer to pointer
    in C
    it doesn't compile. When I use the following trick it does compile. I create an extra operation 'getValue' in ClassB. 'getValue' in ClassB returns itsClassC[0]->getValue();

    So now I call from ClassA: itsClassB->getValue();

    The (first) error message that is generated when I use itsClassB->itsClassC[0]->getValue(); directly is:

    'itsClassC' : cannot access protected member declared in class 'ClassB'....
    See more | Go to post

    Leave a comment:


  • Omega
    started a topic pointer to pointer
    in C

    pointer to pointer

    Hello,

    I'm working on a project with a couple of classes connected via aggregations like this:

    ClassA <>---1 ClassB <>---5 ClassC

    ClassC contains int value;

    Now ClassA declares ClassB as: ClassB* itsClassB
    And ClassB declares ClassC as: ClassC* itsClassC[5]

    Normally, I could get 'value' by using 'itsClassC[0]->getValue();' from within ClassB. But now...
    See more | Go to post
No activity results to display
Show More
Working...