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.

h4ever

Member
Aug 30, 2013
163
0
0
Last edited:

h4ever

Member
Aug 30, 2013
163
0
0
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];
 

h4ever

Member
Aug 30, 2013
163
0
0
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 ';'
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
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?
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
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.
 

h4ever

Member
Aug 30, 2013
163
0
0
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:

h4ever

Member
Aug 30, 2013
163
0
0
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: