|
Global variables are almost always a bad idea. You're better off creating a class with a static public variable. The main reason is that you have some ability to control/track access of the variable that way.
The easiest way to add a global is to declare it in your stdafx.cpp. You may need to declare it in stdafx.h, but I'm pretty sure from memory that stdafx.cpp is the place to make it visible across your app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
The easiest way to add a global is to declare it in your stdafx.cpp. You may need to declare it in stdafx.h, but I'm pretty sure from memory that stdafx.cpp is the place to make it visible across your app.
Yes you are right. Create the global variable in stdafx.cpp and the extern part in stdafx.h and bingo!
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
so would it mean that I'll just have to create my struct inside a class?
|
|
|
|
|
If you were going to have a global as a static property with get and set methods in a class, then yes, you'd define the struct in the same header file, before you defined the class. Or define it in the CPP and forward declare it, if you choose to store it as a pointer.
If you put it in stdafx, then you define it in stdafx.h, I would have thought.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I guess i'll just have to do it in stdafx.cpp and stdafx.h., thanx
|
|
|
|
|
Well, you can do it either way, but doing it in a class is definately better, and no harder.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I've placed the struct on stdafx.cpp then the extern part on stdafx.h. But 'undeclared identifier' error still occurs
|
|
|
|
|
oh.. undeclared identifier is no longer the error. The error now is at the stdafx.h. I guess I've placed it in the wrong area. Where am I exactly allowed to place the externs? Sorry for the disturbance
|
|
|
|
|
benjnp wrote:
The error now is at the stdafx.h.
What error?
benjnp wrote:
Where am I exactly allowed to place the externs?
After those includes
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
k thanx
|
|
|
|
|
Hi, CPians!
Problem: I gonna be in charge of my local 'POLICE' to write an application which is able to recognise speech(human voice) and handwriting of my native language and local peoples.
Please, Help me in:
I have not any idea of the required process.(Speech recognition,image processing,... )
-Do I accept it or not?<br />
-How many days, Months, or years!! it might take?<br />
-Where can I find any links or helps on this topic?
Thank you so much in advanced.
Help me please. All in front of me is darkness now, I need a light of information and knowledge.
Any, any help would be appreciated.
|
|
|
|
|
Hamed Mosavi wrote:
which is able to recognise speech(human voice) and handwriting of my native language and local peoples
Great....
Hamed Mosavi wrote:
Do I accept it or not?
I think we both know the answer. Lets review the facts:
1. You don't know how to do the job
2. Products that do this cost a lot of money ( therefore are not trivial )
3. The police have guns.
Hamed Mosavi wrote:
How many days, Months, or years!! it might take?
days ? LOL
Hamed Mosavi wrote:
Where can I find any links or helps on this topic?
Google, I guess, but I sure wouldn't take this job. I've taken jobs where I had no idea how to do something, but they were SPECIFIC image processing tasks, an area I am broadly familiar with, and I'd found papers describing different approaches to the problem, so it was a calculated risk. What you're suggesting to do sounds more like madness.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you Mr.Christian Graus.
But Some notes:
-First version will need just to be able to compare two voices saying the same sentence.
-Some years ago I was asked to write my first application which had to convert some data from their old format(in a DOS app.) to new data and insert them into SQL Server. I was a begginer in C++ (now think about VC++ ) but I accepted it(another maddness ) and it was all success
Will this situation not tobe the same?
-- modified at 22:49 Tuesday 13th September, 2005
Well! you are right.
look at my first resault of a google
Handwriting recognition has always been tough problem. It takes years to come to a commercially valuable result in this area - years of research, ...
Why don't think about my university projects, instead
Thank you very much
|
|
|
|
|
Hamed Mosavi wrote:
Will this situation not tobe the same?
No, because the other problem is well documented and commonly done. There were a lot more sources of information available to you, and it was the sort of stuff that a computer does easily, it was not a complex coding task.
Amazon appears to have numerous books on speech recognition, most of which come with toolkits. They are all pretty expensive, but I'd buy a couple and read them before committing to a job like this.
Christian Graus - Microsoft MVP - C++
-- modified at 22:47 Tuesday 13th September, 2005
|
|
|
|
|
Thank you.
I modified last message!
Excuseme, I know it's stupid but, I think thhis sentence is wrong, isn't it?(Will this situation not tobe the same?) could you please tell me the true one? (I'm not english!)
and Thank you very much for your kind answer
lots of, lots of:
|
|
|
|
|
Hamed Mosavi wrote:
Will this situation not tobe the same?)
Wouldn't this situation be the same ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes!
'not' should be at the beggining. Got it!
Thank you very much, indeed.
|
|
|
|
|
I call projects like this research projects.
First, if you have never done and speech recognition, do as Christian suggested and go buy a book.
Better yet (BFO attack), go see if you can buy something off the shelf and integrate it. I doubt your local police department has the resources to fund a project like this - sounds like to me they have no idea what they are even requesting.
A little story... I used to work for a telephony company that had a voice activated product feature - thus, we needed some semblance of speech recognition. One of the developers working on the project was Chinese. No matter how hard she tried, she could not get the VR to respond to her accent. This is just one of the technical hurdles you will need to overcome. You might be able to do it with an existing product. Develop your own? Unlikely.
chg (my opinion only).
Oh, handwriting is just as difficult. One other oh - I would bid this project time and materials only. Too much risk for a fixed price.
C. Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
|
|
|
|
|
Thank you!
I asked some of my people. Some one did this job already in my country.I introduced him to the boss. I'm sorry to answer late. It's because I went to sleep yesterday. I eas unable to stay awake even a single second!!!!!!!!!!
Thank you.
Regards
|
|
|
|
|
Hi.
I have an application, (MFC application using VC++ 6.0), runing in all the windows PC OS, (from Windows 98 to Windows XP), and now, I want to run that program in a Palm using Windows CE, (3.0 or 5.0).
The question is: can I migrate that program to windows ce keeping the main development in Visual C++?.
I.E -> I'm using many MFC arrays like CByteArray, CWordArray, CObjetArray, etc.
I'm using serialization.
And many things of MFC., (Dialogs Class and Windows Class, etc)
All this will work in Windows CE 3.0 or 5.0??
Or should I make an all new application using .NET??
Thank you in advance.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Demian - usually, it's best to start on Windows CE and go the other way. I've just spent the last 2 years of my life on a Windows CE project. It is still going strong..... It's pure MFC with activeX, dialogs, etc. My experience is that *most*, not all of the desktop will run on Windows CE.
Question 1: Usually, Windows CE devices have much, much smaller screen real-estate. How might this impact your application?
OS Version: At a minimum, 4.2 (MS calls it .net) or just go to 5.0.
As I said above, most will run in CE, but the compiler will let you know what is missing. Serialization has it's limitations. Also watch out for unicode issues.
New app - that all depends... I'd need to know more about what your desktop app does....
Let me know.
C. Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
|
|
|
|
|
Thank you very much Gilley.
But, one more thing. For continue working with VC++ 6.0 and building new applications for Windows CE, should I use Microsoft® eMbedded Visual Tools 3.0 (or later) isn't?
That's what I must to add to my Visual Studio. Or what else?
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Heh, heh - not laughing at you, just remembering much angst trying to figure out how to do this. The general answer to your question depends on what you want to do philosophically. In any event, you will need to install Embedded Visual C++, a completely separate environment from VS. Version 3.0 is very old, I use 4.0. Don't forget that you will need an SDK. Follow up with any questions...
Options:
- you can use the same code base, pulling it from version control. If you do this, then the
embedded VC++ and VC++ areas need not be the same.
- if you want combined projects / don't use version control, then you tend to toss everything
into the same folder. Since the VS project already exists, you simply create an EVC++ project
in the same location (VS workspace files are .dsw, EVC++ are .vcw), then add the source files
to it.
WARNING! I've only done this with an activeX control project, so try this on a small project first and make backups.
Let me know if I can answer any other questions....
C. Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
|
|
|
|
|
Hello All, I have an application that runs without error on my own system. Even in release mode . However, when i run the application on other systems, my app reports to me that it was undable to aquire a crypt context (CryptAcquireContext) due to an invalid param.
This code is called in a simple C worker thread. Any Ideas?
<br />
UINT stringHash(byte* message, char* hash){<br />
DWORD hashLen = 16;<br />
<br />
HCRYPTPROV hCryptProv;<br />
HCRYPTHASH hHash;<br />
<br />
<br />
ZeroMemory(&hCryptProv, sizeof(hCryptProv));<br />
ZeroMemory(&hHash,sizeof(hHash));<br />
<br />
BYTE hashedBytes[16];<br />
<br />
<br />
if (!CryptAcquireContext(&hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0)){<br />
CryptReleaseContext(hCryptProv,0);<br />
return GetLastError();<br />
}<br />
<br />
...<br />
|
|
|
|
|
|