|
I am trying it in embedded VC++ .
If I post it in the embedded forum, it takes days to get a reply. sometimes no reply at all.
I posted here bcoz I thought the error was common.
-hithesh
|
|
|
|
|
Hi,
Are you sure that yours project settings are correct?
if you are working with the emulator,you need to choose these options from
the combo box of the editor:
from the "Select active configuration" combo box,select the "Win32 (WCE emulator) debug/release" option.
form the "select default device" combo box select the "Pocket PC 2003 emulator" option.
if you are working directly with your IPaq,you need to choose these options from the combo box of the editor:
from the "Select active configuration" combo box,select the "Win32 (WCE ARMV4) debug/release" option.
form the "select default device" combo box select the "Pocket PC 2003 device"
option.
Note :
1. I think the debug option is better then the release option,because
the release option has a lot of bugs.
2. I saw your question about "How to download my application to my device".
Well,you need to put your ipaq in the cradle,choose the options above
(not for the emulator!!!) and Execute the program(ctrl + F5 , but i'm not
sure)
3. Make sure that you chose the correct option for the default device AND for
the active configuration(do not mix between option for the active
configuration and option for the default device).
Well,I hope this will help you.
Good luck,
Eli;)
|
|
|
|
|
Hi Guys.
I really would appreciate some help with this cause I'm drawing
nothing but blanks!
I made my first Visual C++ program in ver. 7. Its a client/server
networking filetransfer sort of a program. The problem occurs when
I start the client program on another machine, that hasn't got VC++
installed. At first it complained that is was missing some DLL's.
Unable to find out how to get the same results as you do with Borland
C++ Builders, Disable runtime packages and Dynamic linking (which compiles
everything into a single huge .exe) I tried using MFC (the program is
dialog style) as a static library and as windows standard. This works,
the program now actually runs. But as soon as I try to initiate a file-
transfer, the program is shutdown by windows due a critical error.
Please help me out.
Shine
|
|
|
|
|
Extra note:
I think the error might come from this like in sockcore.cpp:
if (pState->m_pmapSocketHandle->IsEmpty())
Im not sure though
Shine
|
|
|
|
|
Try running the program under the debugger, so that you can see where it stops. If the program stops in a library routine, chances are you have provided a bad argument value.
When you are debugging this sort of application, you really need to run both the client and the server in the debug environment, so you can tell what is happening.
Software Zen: delete this;
|
|
|
|
|
i need help in calling matlab functions from c++ i got some examples but when i implement them i get an error saying that <matlab.h> and many other library files are undeclared . So i want to know if <matlab.h> is already found on the VC++ complier or need to be included and if so where can i find it and how can i include it .
gobar
|
|
|
|
|
bPulseStream.add(0xdb);
bpulsestream is of type CBytearray
This is used to generate a 40Khz IR pulse.
Here's the full code -
#define CharWidth 73<br />
<br />
bPulsestream.Setsize(charwidth*4, 16); <br />
<br />
for(int i=0; i < charwidth*4; i++)<br />
<br />
{<br />
bpulsestream.Add(0xdb);<br />
<br />
}
Thanks in advance.
-hithesh
|
|
|
|
|
hithesh wrote:
Thanks in advance.
Thanks for what? You did not mention what you needed help with.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Can someone explain why charwidth is 73 and why is bPulsestream 0xdb. If someone can decipher that code, it would be great.
-hithesh
|
|
|
|
|
The code snippet you provided, while syntactically incorrect, generates nothing and has nothing to do with IR pulses. It simply adds the value 0xdb to a CByteArray object 292 times.
You'll need to consult the source of this code to figure out how and why those specific values are used.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am using a read-only edit control to display a log file on a property page, but on w9x I am getting EN_ERRSPACE errors if the file is much over 62K. Now I can handle this by stopping reading the file at the 62K mark if running w9x, but I really would like a workaround to be able to display the entire file. I am using an edit control for it's built in text selection and clipboard support.
Would a rich edit control be better? or does it suffer from the same limitations?
What is the text size limit for w2k/xp? Do I also have to limit the log file on those platforms?
I have read in MSDN[^] that one can use the DS_LOCALEDIT dialog style (Can one use that style on a single property page, or does it then apply to all pages?) and the EM_GETHANDLE and EM_SETHANDLE messages to manage the memory yourself. But looking up DS_LOCALEDIT in MSDN[^] it says that DS_LOCALEDIT only applies to 16 bit windows, which makes it rather useless.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
PJ Arends wrote:
Would a rich edit control be better?
Yes.
PJ Arends wrote:
or does it suffer from the same limitations?
No.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks, rich edit control it will be.
Now I just have to figure out how to use one of them things
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I'm trying to write a Unicode Filename, both the filename and the data in the file are Unicode. I thought that I should use wofstream to do this. Does anyone know why wofstream only takes a const char * and not unicode? Is there another way to open a file to write to that I can use Unicode chars in its name?
This is the error I get from the following line of code.
wofstream outfile(pFileName);
error C2664: '__thiscall std::basic_ofstream<unsigned short,struct="" std::char_traits<unsigned="" short=""> >::std::basic_ofstream<unsigned short,struct="" std::char_traits<unsigne
d="" short=""> >(const char *,int)' : cannot convert parameter 1 from 'unsigned short *' to 'const char *'
There has to be a way to create a file with a unicode name or there is no point lol
thanks for any help regarding this.
|
|
|
|
|
I recently saw something like this, and was wondering what's the benefit.
struct MyStruct
{
// etc.
};
Later on in the program, I saw:
struct MyStruct* pMyStruct;
===================
What's the point of using the 'struct' keyword (a second time) to define a pointer to a structure that's already defined? It compiles fine, but what purpose does it serve?
Any sensible explanation will be appreciated.
William
Fortes in fide et opere!
|
|
|
|
|
It was required in C, but not in C++. Old habits die hard, I guess.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
You see quite a bit of C-style coding in C++. And I find that it just makes maintaining C++ even more horrible than it actually is.
Kevin
|
|
|
|
|
Yep. I cringe whenever I run across the old
typedef struct StructName {
} StructName; that I used to have to do in C all of the time.
Software Zen: delete this;
|
|
|
|
|
Hi,
I´m using VS.NET 2003 and I´m having some odd linking errors and I would appreciate if anyone could explain to me why, and how I could solve this.
I´ve done this simple example to show you what I mean.
car.h<br />
#pragma once<br />
#include <iostream><br />
using namespace std;<br />
<br />
void decfunc();<br />
char *msg;
car.cpp
#include "car.h"<br />
<br />
void decfunc()<br />
{ <br />
msg = new char[12];<br />
msg = "Hello world!";<br />
}
main.h
#include "car.h"<br />
using namespace std;
main.cpp
#include "main.h"<br />
<br />
void main()<br />
{<br />
decfunc();<br />
cout << msg;<br />
}
The link errors I receive are:
tests error LNK2005: "char * msg" (?msg@@3PADA) already defined in main.obj
tests fatal error LNK1169: one or more multiply defined symbols found.
Thanks!
|
|
|
|
|
add following lines to car.h:
#if !defined(_CAR_H)
#define _CAR_H
...
your previous code
...
#endif
so char*msg will be defined only once.
I hope it will help
Marcin Wojciechowski
|
|
|
|
|
Hi Marcin, thanks for your reply
acctualy, it didnt work. My car.h now looks as follows:
#if defined(_CAR_H)<br />
#define _CAR_H<br />
<br />
#include <iostream><br />
using namespace std;<br />
<br />
void decfunc();<br />
char *msg;<br />
<br />
#endif
and I still get the same link errors
error LNK2005: "char * msg" (?msg@@3PADA) already defined in car.obj
fatal error LNK1169: one or more multiply defined symbols found
I´m having a hard time seeing what makes it being defined twice.
Does it have something to do with the decfunc-function perhaps?
|
|
|
|
|
In car.h:
extern char *msg;
In car.cpp:
char *msg = NULL;
...cmk
Save the whales - collect the whole set
|
|
|
|
|
great! Thanks.
humpa humpa
|
|
|
|
|
I want to write a program to show a BMP , which is so big that the PC has not enough memory to load , can you give me some clews ? if you have the code please mail me , thanks a lot .
|
|
|
|
|
#include<iostream.h>
#include<iomanip.h>
#include<math.h>
void optimization(double x[3][2]);
double power(double x,int n);
double F(double x[2]);
double fun(double x[3][2],double xm[2] );
double a,k,b,v,E,p,q,y;
double x[3][2],fx[3],*xh,*xl,*xg;
double temp,fxh,fxl,fxg,fxm,fxr,fxe,fh1,fxc;
double xm[2],xr[2],xe[2],xh1[2],xc[2];
void main()
{
cout<<"输入边长值:"; cin>>a; cout<<"输入反射系数:"; cin>>k; //输入原始数据
cout<<"输入收缩系数:"; cin>>b; cout<<"输入扩伸系数:"; cin>>v;
cout<<"输入容差:";cin>>E; cout<<"输入的初始顶点:";
cin>>x[0][0]>>x[0][1];
p=(sqrt(2+1)+2-1)*a/(sqrt(2)*2); q=(sqrt(2+1)-1)*a/(sqrt(2)*2); //建立初始单纯形
x[1][0]=x[0][0]+p; x[1][1]=x[0][0]+q; x[2][0]=x[0][0]+q; x[2][1]=x[0][0]+p;
optimization(x);
}
double F(double x[2])
{
double f;
f=3*power(x[0],2)+power(x[1],2)-12*(x[0])-8*(x[1]);
return f;
}
double power(double x,int n)
{
int i; double p=1.0;
for(i<1;i<=n;i++)
p=p*x;
return p;
}
void optimization(double x[3][2])
{
fx[0]=F(x[0]); fx[1]=F(x[1]); fx[2]=F(x[2]);
for( int i=0;i<3;i++)
{
for(int j=1;j<2-i+1;j++)
{
if(fx[i]<=fx[i+j])
{
temp=fx[i];
fx[i]=fx[i+j];
fx[i+j]=temp;
}
}
fxh=fx[0]; fxg=fx[1]; fxl=fx[2];
}
for(i=0;i<3;i++)
{
if(F(x[i])==fxh) xh=x[i];
if(F(x[i])==fxg) xg=x[i];
if(F(x[i])==fxl) xl=x[i];
}
xm[0]=(xg[0]+xl[0])/2; xm[1]=(xg[1]+xl[1])/2; fxm=F(xm); // 计算反射中心
xr[0]=(1+k)*xm[0]-k*xh[0]; xr[1]=(1+k)*xm[1]-k*xh[1];fxr=F(xr); //计算反射点
if(fxr>=fxl&&fxr<fxg)
{
="" xh[0]="xr[0];xh[1]=xr[1];
" if(fun(x,xm)<e)
="" cout<<"最优解为:"<<xm[0]<<endl<<"最小值为:"<<fxm<<endl;
="" else="" optimization(="" x);
if(fxr<fxl)
="" xe[0]="(1-v)*xm[0]+v*xr[0];
" xe[1]="(1-v)*xm[1]+v*xr[1];
" fxe="F(xe);
" if(fxe<fxr)
="" xh[1]="xe[1];
" if(fun(x,xm)<e)=""
="" optimization(x);
="" }
="" else
="" }
="" if(fxr="">=fxg)
{
fh1=fxr<=fxh? fxr:fxh;
if(fxr<=fxh)
{
xh1[0]=xr[0];xh[1]=xr[1];
}
else
{
xh[0]=xh[0];
xh1[0]=xh[1];
}
xc[0]=(1-b)*xm[0]+b*xh[0];
xc[1]=(1-b)*xm[1]+b*xh[1];
if(fxc<=fh1)
{
xh[0]=xc[0];
xh[1]=xc[1];
if(fun(x,xm)
|
|
|
|