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

Search:

Type: Posts; User: xargon

Page 1 of 14 1 2 3 4

Search: Search took 0.16 seconds.

  1. Thread: Design help

    by xargon
    Replies
    2
    Views
    833

    Design help

    Hello,

    I have been thinking about this all day and I am yet to come up with a good solution. So, I need to design an image class which should work with various data types (int, float, double etc.)...
  2. Replies
    9
    Views
    1,466

    Re: Can I do any optimization on this code?

    hello,

    Sorry. It was not my intention to disappear but I had a terrible shoulder problem and was indisposed for a few weeks and might have to undergo a small surgery later. I was actually told not...
  3. Replies
    9
    Views
    1,466

    Can I do any optimization on this code?

    Hello,

    I have a function where a particular chunk of nested loops takes majority of the time. I call this function a lot, so any speedup would be most welcome. I was wondering if anyone can spot...
  4. Replies
    1
    Views
    614

    Multidimensional array indexing

    Hello all,

    I am porting some C# code to C++ and there is a particular bit that has me a bit perplexed. The code is as follows:



    byte [,,] data = new byte[d,h,w];
    int i=0;

    for (int z = 0;...
  5. Replies
    6
    Views
    1,179

    Re: slow array indexing

    This particular case is only 64x64, so not that large.

    Ok, it seems that the real culprit actually is this line:

    index += static_cast<int>(floorf((float)values[i]) * offsets[i]);

    and not the...
  6. Replies
    6
    Views
    1,179

    slow array indexing

    Hello everyone,

    I have a severe performance decrease when I am accessing random locations in a C-array. So, I have a function which is briefly as follows:



    template<typename T>
    int...
  7. Replies
    9
    Views
    1,648

    Re: Question on how to traverse this array

    That is irrelevant. I am smoothing each axes using wavelet filtering. What would be the point of putting that in my question? I do not understand what you do not understand about wanting to traverse...
  8. Replies
    9
    Views
    1,648

    Re: Question on how to traverse this array

    It is not the same at all.

    I am not traversing the array sequentially but along the three axes.

    You can imagine it to be a three dimensional array and each loop is traversing one of the...
  9. Replies
    9
    Views
    1,648

    Question on how to traverse this array

    Hello everyone,

    I am unable to figure how to code the following in C++. It is quite simple when the dimensions of the input array is preset. However, I am at a loss on how to do this when that is...
  10. Replies
    0
    Views
    583

    Managed/Unmanaged code intraoperability

    Hello everyone,

    I have been trying to cast some pointers in 'unsafe' code block but running into the following error:
    error CS0208: Cannot take the address of, get the size of, or declare a...
  11. Replies
    12
    Views
    1,516

    question about this cast

    Hello,

    Can I do this?



    float tt = 15.57;
    float *pt = &tt;
    unsigned *it = reinterpret_cast<unsigned *>(pt);
    std::cout << *it << std::endl;
  12. Replies
    2
    Views
    1,156

    Calling managed code from my unmanaged DLL

    Hello,

    I currently have an unmanaged DLL written in C++ and I can call the exported methods in this DLL from my C# app without any problems and it works quite well.

    Now, I need to call from...
  13. Replies
    2
    Views
    604

    C++ DLL question

    Hello,

    I have a small DLL written in C++ that exports 4 functions. I call this DLL from my C# application and can call all these functions without any problem.

    I want to arrange for a DLL...
  14. Replies
    1
    Views
    2,358

    Re: Interoperability between C# and OpenGL

    Ok, I fixed that problem. So, there were two issues:

    First, I had to call ReleaseHdc on the graphic object.
    Secondly, the HDC parameter should have been declated as an 'out' parameter.
    ...
  15. Replies
    1
    Views
    2,358

    Interoperability between C# and OpenGL

    Hello everyone,

    I am trying to use some managed code with some unmanaged rendering functions using OpenGL. I have a C# bitmap and I am trying to use OpenGL functions to draw on this bitmap.
    ...
  16. sharing bitmap data between managed and unmanaged code

    Hello,

    I have a bitmap object that is created in C# and I want to share this bitmap between managed and unmanaged code.

    So, I have something as follows in my C# code:



    void DrawGraphic()...
  17. Replies
    0
    Views
    1,264

    Drawing in a C# window from unmanaged code

    Hello everyone,

    I have a C# application that allows users to write some plugins. I have an app that I have written in C++ and OpenGL and I want to write a plugin that encapsulates that app.

    So,...
  18. Replies
    3
    Views
    836

    Re: Unmanaged window inside a managed app

    Hello,

    Thanks for the reply. What I wanted was basically that all GUI events would be marshalled and passed to the unmanaged window and maybe I could write some simple wrapper around the unmanaged...
  19. Replies
    3
    Views
    836

    Unmanaged window inside a managed app

    Hello everyone,

    I have a managed app that I have inherited and I have another GUI application that is written using Qt and OpenGL. What I would like to do is create an instance of my unmanaged GUI...
  20. Replies
    17
    Views
    3,121

    c++ precision question

    Hello everyone,

    I have a question about doing arithmetic with C++. Say I have something like:

    (71/10) - 7.0 and it gives me something like: 0.0999999. How can I get it to give me 0.1.
    ...
  21. Replies
    7
    Views
    1,261

    Re: Optimization question about array access

    Yes, the sub-blocks will not be contiguous. It is a 3D array and I have certain offsets after reading each line of the sub-block.

    Thanks again everyone.

    xarg
  22. Replies
    7
    Views
    1,261

    Re: Optimization question about array access

    The underlying datatype are floats or doubles. Can I still use memcpy without any problems? I am always scared of using bulk copy!

    The comments about using STL and boost are very valid but...
  23. Replies
    3
    Views
    737

    Re: strange variable passing

    I think you have to parse the input string using functions like atof or atoi.

    cin >> atof(side1);

    ... etc.

    xarg
  24. Replies
    7
    Views
    1,261

    Optimization question about array access

    Hello everyone,

    I have a bit of code which needs to read sub-blocks of data in a big array. So, the big array represents a 3D dimensional structure in memory and I need to access a cube like block...
  25. Replies
    6
    Views
    7,702

    Re: comparing with FLT_MIN and FLT_MAX

    I did not make that explicit. FLT_MAX is defined in float.h

    The reason is that one function marks some array elements as FLT_MAX to indicate that they should not be part of some computation. I...
Results 1 to 25 of 342
Page 1 of 14 1 2 3 4





Click Here to Expand Forum to Full Width

Featured