Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
J

Jordan C Atlas

@Jordan C Atlas
About
Posts
23
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Lists, maps, etc
    J Jordan C Atlas

    Is there a .NET framework equivalent of lists, vectors, maps, etc. in the C++ standard library? Thanks, --Jordan

    .NET (Core and Framework) csharp c++ dotnet question

  • getting text of selected item in listview
    J Jordan C Atlas

    lv_files->SelectedItems[0]->Text

    Hi - I'm having this same issue. When I try the solution above, I get

    error C2227: left of '->Text' must point to class/struct/union

    (The intellisense also warns me that it won't work.) My code is: String* test = listView_Main->SelectedItems[0]->Text; Any suggestions? Thank you, --Jordan

    C / C++ / MFC question csharp dotnet visual-studio help

  • Database connection in .NET
    J Jordan C Atlas

    Thanks Ed. It looks like I need to use an OleDbConnection. --Jordan

    C / C++ / MFC database question csharp sql-server dotnet

  • Database connection in .NET
    J Jordan C Atlas

    Hello, Is there a way to make a connection to an access database using the .NET framework? So I'm looking for functionality like what is in System.Data.SqlClient, but I'd like to connect to an access database. Also, when you pass a "connection string" to a SqlConnection object, you need to include a database name.. Does that name refer to an ODBC connection or just to the name of the database in SQL server? Thank you, -Jordan

    C / C++ / MFC database question csharp sql-server dotnet

  • Debug Assertion Failed when calling dll function
    J Jordan C Atlas

    Yes! That fixed it. Thanks. So it's not allowed to create a managed function that uses an unmanaged class as input? --Jordan

    C / C++ / MFC tutorial debugging help question

  • Debug Assertion Failed when calling dll function
    J Jordan C Atlas

    Even if I remove the whole function body, I get the same error. So, right now it looks like this: __declspec(dllexport) int func(string inputFileName) { } -- modified at 13:10 Friday 20th January, 2006

    C / C++ / MFC tutorial debugging help question

  • Debug Assertion Failed when calling dll function
    J Jordan C Atlas

    Hello, I am using managed code to call a function in an unmanaged DLL. When I call the function, the program runs until the end of the function, and then gives a "Debug Assertion Failed!" dialog box for "Expression: _CrtIsValidHeapPoint(pUserData)". The error occurs no matter what code I have inside the function. For example, removing all the code in the dll function, so that it's just an empty function, does not prevent the error. The only thing that I've done to prevent the error is to comment out the line that calls the dll function. This is how I import the function: // Set up the import [DllImportAttribute("lib.dll")] extern "C" int func(string inputFileName); This is the function declaration in the DLL code: __declspec(dllexport) int func(string inputFileName) Does anyone have any suggestions for how to track this down? Thanks, --Jordan -- modified at 13:10 Friday 20th January, 2006

    C / C++ / MFC tutorial debugging help question

  • Unable to find an entry point when loading an unmanaged DLL
    J Jordan C Atlas

    Stephen, The function was declared as: LIB_API int function(void); where I have #define LIB_API __declspec(dllexport) Changing it to: extern "C" LIB_API int function(void); seems to have fixed the problem -- I'd be happy to hear an explanation for that if you have one. Thanks, --Jordan -- modified at 0:14 Friday 20th January, 2006

    C / C++ / MFC c++ help question

  • Unable to find an entry point when loading an unmanaged DLL
    J Jordan C Atlas

    I found the problem -- I was using an improper function prototype for the shared function. I reset the import to say: // Set up the import [DllImportAttribute("lib.dll")] extern "C" int function(); I'm not sure why the extern "C" is necessary, so here is a link to the article that tipped me off: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcreatingprototypesinmanagedcode.asp[^] Thanks again to Stephen for his suggestion. --Jordan

    C / C++ / MFC c++ help question

  • Unable to find an entry point when loading an unmanaged DLL
    J Jordan C Atlas

    The ExactSpelling attribute did not fix it (I get the same exception), but thank you for the suggestion. --Jordan

    C / C++ / MFC c++ help question

  • Unable to find an entry point when loading an unmanaged DLL
    J Jordan C Atlas

    Hello, I have an unmanaged C++ dll that I would like to load in a managed C++ application. I can call methods in the dll from an *unmanaged* program with no issues. I set up the import using: // Set up the import [DllImportAttribute("lib.dll")] int function(); The project is correctly set to find the libary files. When I run the compiled program, it throws an execption at the line: function(); The exception is: An unhandled exception of type 'System.EntryPointNotFoundException' occurred in testManaged.exe Additional information: Unable to find an entry point named function in DLL lib.dll. This error indicates that it cannot find the function in my libarary, but I know the function is there and accessible because I can access it from unmanged code. Is there something wrong with my import statement? Anything else? Thanks, --Jordan -- modified at 23:40 Thursday 19th January, 2006

    C / C++ / MFC c++ help question

  • Using c++ to write c++
    J Jordan C Atlas

    Hi, Thanks for the replies. The XML file is a representation of a model (variables and equations). The program that I'm trying to have it automatically write will solve the system of equations represented in the XML file. I'm trying to do this so that the (compiled) new simulation program will be faster than if I repeatedly sampled information in the XML file... --Jordan

    C / C++ / MFC c++ question xml help lounge

  • Using c++ to write c++
    J Jordan C Atlas

    Hello, I'm interested in writing a program that reads an XML input file, and then based on the content of that file, writes another program which is then compiled. I imagine that I'd do this by defining an ofstream and literally writing the new prorgram line by line. The "preprocessing" program would look something like this: ofstream out("program.cpp"); out << "int main()" << endl; out << "{" << endl; out << "return 0;" << endl; out << "}" << endl; Where I'd have to write the relevant functions for my problem. I'd then run the proprocessing program and compile the "new" program using a batch file. My question is this: Is there a name for this type of programming? I'd like to read up about it in general before I dive in but the searches I have done haven't revealed much. Also, does MS VC++ provide any helpful methods for writing such programs? Thanks, --Jordan Atlas

    C / C++ / MFC c++ question xml help lounge

  • pointers to objects in lists
    J Jordan C Atlas

    Christian Graus wrote: but either way, if a pointer is copied, it still points to the same memory address. Yes, but if I have a function like this: void ClassB::addObjectToClassA() { Object* newObject; Aptr->addObject(newObject); } What happens after the function exits? Does the pointer point to anything (sensible) anymore? Thanks, -Jordan Atlas

    C / C++ / MFC question

  • pointers to objects in lists
    J Jordan C Atlas

    class classA { public: //uses push_back to add a new Object to objectList addObject(Object newObject); private: list objectList; }; class classB { private: classA* Aptr; void addObjectToClassA(); }; void ClassB::addObjectToClassA() { Object newObject(); Aptr->addObject(newObject); } Hello all, I have what is probably a simple question, but I've been wrestling with it for a while. I have code that looks like what I typed above. classA has an std::list of Objects. classB has a method that will add a new Object to that list in classA. As I understand it, it creates a copy of the Object and the copy is what is added to the list. How can I iterate over objectList and actually modify the objects in the list? When I iterate now it seems that the Objects in the list are not modified... It seems that copies are modified instead. I thought one option would be to make objectList a list of pointers to Objects instead... But what will happn when I add an object to the list in classB? If I create a local Object* and add that to the objectList, does the pointer get added or does a copy of the pointer get added? (I'm just worried that the pointer won't refer to anything after addObjectToClassA() exits). Thanks! -Jordan Atlas

    C / C++ / MFC question

  • Units in c++ (SI or other)
    J Jordan C Atlas

    Does anyone have any experience implementing units and unit conversions in c++? I'm curious if this has been solved in a library or something already... I guess what I'm imagining would be a sort of user-defined type that has a value and a unit associatated with it, and then some overloaded operators to handle operations. Does anyone know of any references that demonstrate such a thing (not necessarily using the method I suggested). -Jordan

    IT & Infrastructure c++ question

  • Pointer to an object in a std::list
    J Jordan C Atlas

    PJ Arends wrote: pointerToObject = &(*listIt); Hey PJ, This code works! Thanks! I usually store pointers in the lists as well, but for some reason I didn't in this case. I'll have to look at the code to see why I implemented it that way. Merci, -Jordan Atlas

    C / C++ / MFC question

  • Pointer to an object in a std::list
    J Jordan C Atlas

    Hello, I'd like to loop over a std::list and for a given element in the list, get a pointer to that element. My code looks something like this: Object* pointerToObject; iteratorType listStart, listEnd, listIt; list objectList = getObjectList(); listStart = objectList.begin(); listEnd = objectList.end(); for(listIt = listStart; listIt != listEnd; listIt++) { pointerToObject = listIt; //This code won't compile --> but it illustrates my intention... I want to get a pointer to an object in the list... } Any ideas? Thanks! -Jordan Atlas

    C / C++ / MFC question

  • Simple File Input
    J Jordan C Atlas

    Thank you - your answer makes sense. I will continue writing the input file using strings. -Jordan Atlas-

    C / C++ / MFC tutorial question design

  • Simple File Input
    J Jordan C Atlas

    To be more specific about the problems I was having: I wanted to try to read the words into string variables so that I could compared them to strings indicating which reaction they correspond to. However, if I try to read the words into std::string variables using something like: inFile >> tempString; then I get a compiler error: error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string,class std::allocator >' (or there is no acceptable conversion) I also tried reading the words into char arrays so that I could comapare the char arrays to the string corresponding to a particular operation. If I do that, however, then the comparison doesn't seem to work. Ie: If I read the word "Account" into a char array called charTemp, the statement (charTemp == "Account") seems to evaluate to false (even tho my intention would be for it to be true). I hope that clarifies the problem rather than making it more complicated! Again, I am open to alternative suggestions. -Jordan Atlas

    C / C++ / MFC tutorial question design
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups