• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

how to start with Visual Studio C++ Express

Page 4 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
Last edited:
The first error is:

syntax error : missing ';' before identifier 'hInst'

But I really don't see missing `; so what's the problem?

Code:
#include <iostream>
#include <conio.h>
using namespace std;

// MyExecRefs.cpp : Defines the entry point for the application.
//

// #include "stdafx.h"
#include "testingClass.h"

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst;                                // current instance
TCHAR szTitle[MAX_LOADSTRING];
 
I have similar problem here:

Code:
    if (PathFileExists(setts.TempPath) && DEL_TEMP_ON_EXIT)
        DeleteFile(setts.TempPath);
I see that the setts.TempPath is undefine&#353;d. But how can I prevent this cause error if not defined?

Code:
error C2143: syntax error : missing ')' before ';'
 
The first error is:

syntax error : missing ';' before identifier 'hInst'

But I really don't see missing `; so what's the problem?

Code:
#include <iostream>
#include <conio.h>
using namespace std;

// MyExecRefs.cpp : Defines the entry point for the application.
//

// #include "stdafx.h"
#include "testingClass.h"

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst;                                // current instance
TCHAR szTitle[MAX_LOADSTRING];

Where do you have HINSTANCE defined?
 
I have similar problem here:

Code:
    if (PathFileExists(setts.TempPath) && DEL_TEMP_ON_EXIT)
        DeleteFile(setts.TempPath);
I see that the setts.TempPath is undefinešd. But how can I prevent this cause error if not defined?

Code:
error C2143: syntax error : missing ')' before ';'

If you are getting an error because a variable is being used and not defined, it makes sense to get it properly defined.
 
Can you tell me why I cannot open the file? I have uploaded the project with text1.scx file in the main directory. Please change the path on line aokts.cpp 401 ... this the path to scenario.

project download

Run the program to line 282, then it will break near the file_ pointer. I got message wrong pointer (place the mouse cursor on the file). Does it mean that the program cannot find the file?
The open action is in utilio.cpp line 14

2ynh1dw.jpg


24enkep.jpg
 
Last edited:
Maybe I was wrong and the handler of the file is set correctly, I just don't understnad the messages in the brackets {}..

Later when I go on in debugging I stuck on this error:
2rndfut.jpg

307nv2c.jpg




This happens when I run FileOpen function. In the scen.reset();

Code:
void Scenario::reset()
5v88zc.jpg


Definition of the esdata.aitypes is in extern class ESDATA, public block:
Code:
LinkList<Link> aitypes;
Definition of the esdata.aitypes.head()

o8s9px.jpg


Definition of the class Link:
Code:
class Link
{
public:
    Link();
    Link(int id, const wchar_t * name);

    bool read(const wchar_t * name, const wchar_t * value);

    Link* next();
    const Link* next() const;
    void setNext(Link*);
    [B]int id()[/B] const;
    const wchar_t * name() const;

private:
    Link* _next;
    [B]int _id[/B];
    std::wstring _name;
};
And the function id()
Code:
inline int Link::id() const
{
    return _id;
}

Now I need to find out what's happenning there.

When I debug (F11) on original project, so on the map.reset() it waits about 10 minutes (I think that the map object is reseted, initiated before it will be filled with values). But when I do it on the changed version so on F11 it jumps in, first into the template head() where it returns _head and then into the Link::id(), where it fails to reach _id and error happens. This looks like access error. The change I did is that I created controller function from where I open my file, instead of opening file from the menu / dialog box.
 
Last edited:
Back
Top