|
To attempt to make a project, I go File->New->Project
That pops up a New Project dialog (shock!)
I pick Visual C++, Smart Device, MFC Smart Device Application.
I give it a name in the bottom fields, and press OK.
The dialog goes away, the main window flashes a bit, and a get a few brief hourglasses.
About 3s later, the New Project dialog comes back...
So, no error, but wrong behaviour.
I already have VC6 installed, so there may be path collisions. As my main work is developed in VC6, I'm not quite prepared to vape my system and just have vx2005 on it...
Any help / hints you can give will be appreciated!
Iain.
|
|
|
|
|
|
Iain Clarke wrote: The dialog goes away, the main window flashes a bit, and a get a few brief hourglasses.
About 3s later, the New Project dialog comes back...
So, no error, but wrong behaviour.
It's not wrong behavior. It means that eVC++ is not able to detect your embedded device connected to your computer. To start a new project, build and deploy/debug it successfully, you need to have your embedded device connected to your computer.
Install ActiveSync, and also install the SDK that came along with your embedded device. By all means I am assuming that your embedded device is running some version of WindowsCE.
Connect your device, let ActiveSync detect it and then open eMbedded Visual C++ and then try starting a new project.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
That sounds like a very good explanation - I just wish it popped up a failure explanation, rather than just coming back.
I've tried it, and its not working yet. I'll find a virgin PC somewhere to reinstall from scratch and try your theory out - but this time with the mobile device plugged in the whole time.
Iain.
|
|
|
|
|
Iain Clarke wrote: I've tried it, and its not working yet.
This thing happened to me too at the beginning. It might be that the version of WinCE running on the handheld is not compatible with your eVC++. If you have VS2K3 installed, then just try a new smart device project (with C#) and if it might work. In this case, you can be sure about the uncompatibility factor.
Also get the service pack[^] installed.
-- modified at 4:43 Tuesday 16th January, 2007
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
I'm using VS2005 with the windows mobile 5.0 sdk as recommended on the microsoft website.
That said, it wouldn't be the first time they're wrong. I'll try to get a copy of eVC4 later and download that. It may be simpler and work more easily! (I hope...)
Iain.
|
|
|
|
|
Is there any way to create a DLL that uses SDI/MDI architecture independenly from the main project (caller of the DLL)?
Is there any simple example with source code that a main applcation calls a simple DLL that loads the its own main frame window?
Regards,
sdancer75
|
|
|
|
|
I have taken a stab at creating my own high-res timer class. It works by launching a thread which queries the high performance counter and calls a callback when when the event is triggered. The trouble is it uses a lot of the CPU's idle time when looping. The full thread callback follows, I wonder if anybody could suggest a way to decrease the CPU usage.
UINT CTimer::ThreadProc( LPVOID pParam )
{
LPTIMERDATA tData = (LPTIMERDATA)pParam;
EnterCriticalSection( &m_csLock );
LARGE_INTEGER lilastTime = m_liStartTime;
UINT_PTR uIdEvent = tData->uIdEvent;
UINT uSleepTime = tData->uSleepTime;
HWND hWnd = tData->hWnd;
LeaveCriticalSection( &m_csLock );
LARGE_INTEGER liCurrentTime;
BOOL bIsActive = TRUE;
do
{
QueryPerformanceCounter( &liCurrentTime );
double dMilliSecs = ( (double)liCurrentTime.QuadPart - (double)lilastTime.QuadPart );
dMilliSecs /= (double)m_liFrequency.QuadPart;
dMilliSecs *= 1000;
if ( (UINT)dMilliSecs % uSleepTime == 0 )
TimerProc( hWnd, WM_TIMER, uIdEvent, GetTickCount() );
EnterCriticalSection( &m_csLock );
uSleepTime = tData->uSleepTime;
bIsActive = tData->bIsRunning;
LeaveCriticalSection( &m_csLock );
Sleep(0);
} while( bIsActive );
_endthreadex( 1 );
return 0;
}
Also I test for the even using if ( (UINT)dMilliSecs % uSleepTime == 0 ) I'm worried this would miss a beat.
|
|
|
|
|
WalderMort wrote: I wonder if anybody could suggest a way to decrease the CPU usage
I don't want to discourage you, but I think you've missed some quite important things. :->
Timing and Windows:
1. Don't mistake the performance counter value given in multiples of 100ns to be the accuracy of the performance counter.
2. Neither one of the windows operating systems are realtime OSs. Thinking in terms of microseconds is pointless in this environment.
3. Your thread will occasionally be preemted by the OS that will execute another thread for at least 10ms.
Read this[^] article for further info.
Threading issues:
When your timer expires you have to call the timer callback but that callback would be called from the context of your timer thread. This often is undesired and you will be forced to post a message to the thread that is waiting for the timer to expire to be able to execute in the correct context.
Read this[^] article to understand why.
Suggested solution:
Use multimedia timers. You'll find info about them here[^].
I've found the multimedia timers to provide the most reliable timing solution with accuracy close to 1ms.
Have the thread waiting for the timer to expire to wait for an event that is set when the timer expires by a call to ::WaitForSingleObject() or similar. The priority of the waiting thread will get boosted temporarily when the event is signalled.
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Thanks for the suggestions. I created this class just to see if I could, call it a 'learning curve'
Roger Stoltz wrote: When your timer expires you have to call the timer callback but that callback would be called from the context of your timer thread.
The class is structured in such a way that either a message is posted or a user callback is called, or a virtual method. It acts much the same as the standard SetTimer(). My use is within a game to regulate speed, rather than use the standard message pump, the timer sets a volatile member of the base thread. This allows me to launch a loop containing a PeekMessage() call and do further processing in the idle time.
Roger Stoltz wrote: Use multimedia timers.
This has always been an open option, and infact I am about to attempt using them.
Thanks for the links
|
|
|
|
|
I use a huge list to save complex data and I save this list to file. the problem is that when an element of this list changes I need to save the entire list to the file. and this consumes alot of time because of I use loop to write element by element to the file.
If any one know a good solution, please reply to me urgent.
Note: the size of each element is dynamic according to the changes the user made every time.
Thank alot.
Michael
|
|
|
|
|
Does this article work for you?
http://www.codeproject.com/file/TextFileIO.asp[^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Use buffered I/O. If you don't want to use fopen/write or CStdioFile, you could roll your own.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi
Every one i am working on VC++ and MySQL as backend ,
Actually i am making an application using it.
Whenever i write connectivity code and run application , found and Linking error. "can not found the libmysql.lib"
Although i have this file in my Library file of Mysql.
i also made the setting in project->setting and all..
I want to know either any specific driver is required for this or Any special setting required.
Can we use this all in Window XP.
Important : Last year i also make this on Win 2000.
Please Help Me.
mailing me
Yogi
|
|
|
|
|
Have you set include path libmysql.lib ?
i.e. using,
options-->tools-->directories-->show directories for-->Library files
|
|
|
|
|
I have created 3 shell extensions that our users have used over the years. Two being a property sheet addition and the most popular being a thumbnail viewer extension. These all work in W2K, XP and Vista 32 bit but not in Vista 64 bit. Does the 64 bit explorer "thunk" to 32 extensions or do I now need to create 64 bit versions of these ? Does it have anything to do with the WOW factor in the 64 bit world, registery, etc ?
Thanks in advance
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
I have a simple DLL project created in VS2003. I don't use MFC, just plain Windows API. I call only FindWindowEx(), SetWindowsHookEx(), UnhookWindowsHookEx(), SendMessage(), PostMessage() and CallNextHookEx(). I export only two of four functions and use only four global variables. Why my relese DLL is ~50kb?? Is VS2003 adding soe other resources? I have seen some DLL's smaller than mine (10-20kb) - how is it possible??
Well, I actualy don't care about the size of this DLL, I'm just curious what makes it so 'big'??
|
|
|
|
|
This fascinates most programmers. Your size depends a lot on the compile settings you have. Are you statically linking into ATL? Is it a debug version? Do you have it optimized for speed or size? Are you using exception handling? All these things take up space, personally I think you've linked into the C runtime library statically, so you have /MD Multi-threaded. If you select /MD you'll link dynamically and won't have to have a copy of strcpy and what not in your application. Some people have been known to make their application really small by not using the C runtime and writing or calling the Windows equivalent of all the C runtime functions.
Hope this helps,
Mark
|
|
|
|
|
I'm not using ATL/MFC. I compile with default "Release" settings for the Win32|DLL project template. When I remove ALL my functions and variables (just plain DllMain(){return TRUE;}) I get ~45kb DLL... Maybe that's this /MD switch... I will try to play with this. Thanks for suggestion.
|
|
|
|
|
"Big"? 50k is pretty good, IMHO.
Change your release mode optimization from "optimize for speed" to "optimize for size".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
PatrykDabrowski wrote: Why my relese DLL is ~50kb??
Read here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I've already read this article. It's interesting but I want to know why this DLL is so 'big' having only couple of functions and variables. I don't care how much memory it would take (adress space, heap etc.) and how to optimize it - I'm just curious what's inside this almost empty DLL. When I remove ALL functions/variables having only DllMain(){return TRUE;} I still get ~45kb DLL....
|
|
|
|
|
PatrykDabrowski wrote: It's interesting but I want to know why this DLL is so 'big' having only couple of functions and variables.
"So big" in terms of the DLL's size on disk, or some number reported by Task Manager?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I mean the size of my DLL on disk.
|
|
|
|
|
Probably because you are statically linking to the C Runtime. There is an option there somewhere to not do that - so that it dynamically links.
Jon Humphreys
ActivePlanet Software
|
|
|
|