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

Search:

Type: Posts; User: superkemo

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    2,096

    Re: Matching predicate for finding substrings

    Alright, well not all is lost. Strcmp does actually seem to provide the correct behavior with the map (you can see that the strings are sorted if you print out using an iterator) and I can fix the...
  2. Replies
    10
    Views
    2,096

    Re: Matching predicate for finding substrings

    I understand what you are saying. That being the case, why does this execute successfully without being determined as an invalid comparator?:



    struct strCmp {
    bool operator()( const char*...
  3. Replies
    10
    Views
    2,096

    Re: Matching predicate for finding substrings

    I'm trying to get this running as fast as possible for processing a lot of string data and I have a working version using strcmp() as the predicate. I just want to expand the program to handle tags...
  4. Replies
    10
    Views
    2,096

    Matching predicate for finding substrings

    I have a map of C-strings which may have embedded tags in them (as substrings). I'm trying to find which strings have tags in them using strstr as a comparison predicate:



    struct substrCmp {...
  5. Re: Maintaining HINSTANCE handle and freeing library

    The problem was indeed the unchecked iterator. Thanks for pointing that out.

    Regarding the lack of complete program flow: I went a bit overboard in cutting down the code to what I thought to be...
  6. Maintaining HINSTANCE handle and freeing library

    While loading dlls in my program I'm trying to keep a map of handles around so that I can free them later:



    typedef std::map<int, HINSTANCE> script_module_types;

    void...
  7. Replies
    6
    Views
    3,542

    Re: Calling cl.exe from inside C++ application

    I have a basic dll build with a batch file I call from in the program:



    CALL vcvars32.bat
    cl.exe -o Script1_d.dll AIScripts.cpp AIScripts.def /ZI /LDd /link /dll
    MOVE "Script1_d.dll"...
  8. Replies
    6
    Views
    3,542

    Re: Calling cl.exe from inside C++ application

    Thanks for the response, Paul. I took a look at devenv.exe but it seems to be for building with a project file, whereas I want to build directly from the source without using a project/solution.
    ...
  9. Replies
    6
    Views
    3,542

    Calling cl.exe from inside C++ application

    I'm trying to use cl.exe to build some code from within my application, without much success.

    Here I'm trying to get a basic compile going with the following test code:



    STARTUPINFOA ...
  10. Replies
    1
    Views
    916

    Using g++ built dll with MSVC

    I have a dll with a .cpp file that looks like this:



    #include <Windows.h>
    #include <map>
    #include <typeinfo>
    #include <iostream>
    #include "Prereqs.h"
  11. Replies
    3
    Views
    2,592

    Re: Heap corruption

    Here is the header and cpp for the AIScene class, where the pointer to the factory resides.



    #pragma once

    #include "..\BaseTypes\TbbSpinMutex.h"
    #include "Creator.h"
    #include...
  12. Replies
    3
    Views
    2,592

    Heap corruption

    I'm having a heap corruption problem "CRT detected that the application wrote to memory after end of heap buffer".

    The problem occurs when I add a pointer to a templated factory class I'm working...
  13. Replies
    1
    Views
    634

    Typeinfo in map

    Hi guys. I am trying to adapt some event handling code that maps an event to a function pointer to use two events mapped to the function instead, so that the function can work on the data in the...
  14. Replies
    4
    Views
    2,356

    Re: Automatic registration in object factory

    Chris F, that's what I have in mind at the moment. What I'm wondering is if there is a way to have my program fill out the map automatically so the user doesn't have to make that function themselves.
  15. Replies
    4
    Views
    2,356

    Automatic registration in object factory

    In a project I am working on I want to put classes into a dll that will be initialized by an abstract factory and included via composition within objects in the main program. The purpose is to allow...
  16. Thread: Void pointer

    by superkemo
    Replies
    3
    Views
    2,361

    Re: Void pointer

    Looks like the crash was being caused by something unrelated. Sorry about that, if I knew how to delete the thread I would but I can't see any delete options on the edit page.
  17. Thread: Void pointer

    by superkemo
    Replies
    3
    Views
    2,361

    Void pointer

    In the code for a C library I am using the author has defined some void pointers eg. here webCoreC is void*

    Code:

    WebCoreC webCore = awe_WebCore_new(); // OK

    WebViewC m_webView =...
  18. Re: Assigning callback functions type mismatch (cdecl?)

    After reading the replies here and following a posted link to read some more on stack overflow and the C++ FAQ I came to this:

    [33.2] How do I pass a pointer-to-member-function to a signal...
  19. Assigning callback functions type mismatch (cdecl?)

    Sup fellas

    Relatively simple guidance required here (I hope!)

    I'm using a C library for my GUI that requires callback functions to be setup. I have no real experience coding in pure C as I...
  20. Replies
    5
    Views
    974

    Re: Struct crashes program in release mode

    I have a function:



    // Construct a top-down tree recursively.
    node* BVH::VBTreeNode(std::vector<OBBShape*> obbArray)
    {
    // Create new node
    node *nodePtr = new node; // <- crashes...
  21. Replies
    5
    Views
    974

    Struct crashes program in release mode

    I'm having an issue in release mode where I can't create a structure using the new keyword.



    struct tester {
    int val;
    };

    tester *testPtr = new tester;
  22. Replies
    17
    Views
    2,904

    Re: Precision issue

    You seem to be right about the 24bit mode being enabled but I am stumped as to how it happened. I can't find any calls to _control87() or _controlfp() in the source and it's not DirectX.

    I put...
  23. Replies
    17
    Views
    2,904

    Re: Precision issue

    double approxLength = gauss_legendre(50,f,NULL,0,1);
    printf("Old number %.40f\n",approxLength);
    double new_number = approxLength * 1000.0;
    printf("Old number multiplied: %.40f\n", new_number);...
  24. Replies
    17
    Views
    2,904

    Re: Precision issue

    Thanks for your replies guys.



    double approxLength = 0;
    printf("&#37;.20ft^4 + %.20ft^3 + %.20ft^2 + %.20ft + %.20f\n", m_quartic.a, m_quartic.b, m_quartic.c, m_quartic.d, m_quartic.e);...
  25. Replies
    17
    Views
    2,904

    Precision issue

    Hi guys. I'm losing precision and I'm not sure why.

    Length 1000.045104980468700000000000000000
    Scaled: 1000045.125000000000000000000000000

    The above output from my program is for two doubles....
Results 1 to 25 of 47
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured