|
The boost library is a lot like STL; it is very efficient if you use it right, but it will also allow you to efficiently specify very inefficient solutions.
The problem with the boost library and embedded systems is generally not efficiency but compiler limitations. Lots of embedded systems don't have good compilers, and parts of boost depend on the compiler being very up to date and complete in the implementation of the C++ standard. That said, one of the boost reference platforms is the gcc compiler which gets used a lot for cross-compiling, so if you are using that you should be OK.
|
|
|
|
|
Hi all
I import a Dialog and its cpp and .h from other workspace, but when i open the classwizard, i can not find the Dialog's class name in Class Name.
what happend?
|
|
|
|
|
You did include it in your project?
Then try do close the IDE, delete your *.ncb-file in your project directory, re-open the IDE and open the classbrowser. Now it must be there, because the class wizard database had been rebuild.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
You might also have to delete the project's .CLW file.
|
|
|
|
|
Close VC++
go and delete the "NameOfProject.clw" in the Projects directory..
then open VC++
open the project
open ClassWizard it will ask you if you want to rebuild the "NameOfProject.clw"
just do it and it will give you what you want
|
|
|
|
|
Hi all,
I developed an application with MFC using SQL server datatbse.. This appliaction runs fine on my machine having windows 2000 Pro.. I am getting an error while running the same applicaiton on any fresh machine...The error i am getting is
Specified SQL server not found
ConnectionOpen (CreatFile())...as far as i can guess this is the problem because there is no SQL server driver installed on fresh machines..what should i do to make it run any machine...i mean is there any way out so that i dont have to install anything else then to run my applicaiton on client side..and it does all.. any help or pointers are highly appreciated..
thanks a lot in advance..
regards,
Himanshu
|
|
|
|
|
You've not shown the actual code that is in error so help is going to be minimal, if at all.
Is the application using ODBC?
|
|
|
|
|
hi,
thanks for the reply...yes i am using ODBC in my application...I am trying to install MDAC with the application..now it seems to work fine on other machines where it already doesn't have MDAC..if it has it shows an error again..is there any solution to it???
Please reply???it's very urgent...thanks a lot in advance..
regards
Himanshu
|
|
|
|
|
Well, I was going to suggest updating the SQL ODBC drivers but that may not do it. If your program works fine on machines without MDAC installed and produces an error on machines with MDAC installed, I'm at a loss.
|
|
|
|
|
hi,
thanks for ur reply...now it doesnt show any error..i am confused however..it was showing the error..but when i built the same setup on my machine(win2000 pro) with installshield..it works fine..and installs the application...and does the work..I am installing MDAC 2.7 ..
thanks a lot anyway..
Himanshu
|
|
|
|
|
I have some codes which I don't know how to continue writing. The code goes like this:
HRSRC hrSrc = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_LOCKUP_EXE), "Exe");
HGLOBAL hGlobal = LoadResource(AfxGetResourceHandle(), hrSrc);
LPVOID lpExe = LockResource(hGlobal);
CFile file;
file.Open("C:\Testing.exe", CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone);
file.Write(lpExe, (UINT)SizeofResource(AfxGetResourceHandle(), hrSrc));
file.Close();
HANDLE hExe = LoadLibrary("C:\Testing.exe");
HRSRC hrSrc2 = FindResource(hExe, MAKEINTRESOURCE(IDR_LOCK_FILE), "LOCKFILE");
HGLOBAL hGlobal2 = LoadResource(hExe, hrSrc2);
LPVOID lpExe2 = LockResource(hGlobal2);
LPBYTE sExe2 = (LPBYTE)lpExe2;
LPTSTR sExe3 = (LPTSTR)sExe2;
CFile file2;
file2.Open("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe", CFile::typeBinary | CFile::modeRead | CFile::shareDenyNone);
CFile file3;
file3.Open(sExe3, CFile::modeWrite | CFile::shareDenyNone);
file3.Write(???);
file3.Close;
For the ???, what should I put in there so that I can insert the AcroRd32.exe as a binary resource into Testing.exe (I don't want to add in the resource manually)? Or should I rewrite some parts of the code?
|
|
|
|
|
|
I understand that. But how can I use the UpdateResource function to transform a file into a resource and update the resource of my program?
|
|
|
|
|
Did you look at the "Updating Resources" example on MSDN?
|
|
|
|
|
Yes. But I am not sure how to create a pointer to point to my file that I want to include as a resource and insert into the UpdateResource function. You know how can I do that?
|
|
|
|
|
HANDLE hInputFile = CreateFile("AcroRd32.exe", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);<br />
DWORD dwFileSize = GetFileSize(hInputFile, NULL), dwBytesRead;<br />
LPBYTE pBuffer = new BYTE[dwFileSize];<br />
ReadFile(hInputFile, pBuffer, dwFileSize, &dwBytesRead, NULL);<br />
CloseHandle(hInputFile);<br />
HANDLE hUpdateResource = BeginUpdateResource("Testing.exe", FALSE);<br />
UpdateResource(hUpdateResource, RT_RCDATA, "Acro", MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), pBuffer, dwFileSize);<br />
EndUpdateResource(hUpdateResource, FALSE);<br />
delete [] pBuffer;
|
|
|
|
|
Thanks for the help. But when I run the program, it gives me this error when I press the OK button:
Debug Error:
Program:..sktop\LockupApplication\LockupBuilder\Debug\LockupBuilder.exe
Invalid Allocation size: 4294967295 bytes
What's wrong? Please help me.
|
|
|
|
|
Ricky Koh wrote:
Invalid Allocation size: 4294967295 bytes
What's wrong?
You cannot allocate that much memory! The absolute maximum that you could allocate is 3GB (and that's only on the advanced flavors of Windows), but that assumes that such a contiguous block exists after everything else is loaded. In reality, the most you could probably get would be little more than 2GB.
|
|
|
|
|
ok. so is there any way to solve this problem ('cause i got this error when I added the code that you have given me into my program)?
|
|
|
|
|
What about the suggestion(s) in this thread?
http://www.codeproject.com/script/comments/forums.asp?msg=605271&forumid=1647#xx605271xx
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks for the reference. I have seen the thread. But, how can I allocate an amount of memory first so that I will not get the allocation problem when I run the program?
My code is now like this:
HRSRC hrSrc = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_LOCKUP_EXE), "Exe");
HGLOBAL hGlobal = LoadResource(AfxGetResourceHandle(), hrSrc);
LPVOID lpExe = LockResource(hGlobal);
CFile file;
file.Open("C:\Testing.EXE", CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone);
file.Write(lpExe, (UINT)SizeofResource(AfxGetResourceHandle(), hrSrc));
file.Close();
HANDLE hInputFile = CreateFile("C:\Documents and Settings\Administrator\My Documents\Testing.txt", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
DWORD dwFileSize = GetFileSize(hInputFile, NULL), dwBytesRead;
LPBYTE pBuffer = new BYTE[dwFileSize];
ReadFile(hInputFile, pBuffer, dwFileSize, dwBytesRead, NULL);
CloseHandle(hInputFile);
HANDLE hUpdateResource = BeginUpdateResource("C:\Testing.exe", FALSE);
UpdateResource(hUpdateResource, "LOCKFILE", "IDR_LOCK_FILE", MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), pBuffer, dwFileSize);
EndUpdateResource(hUpdateResource, FALSE);
delete [] pBuffer;
|
|
|
|
|
Sir,
I am developing FTP in win32 console application like client-server
program. i want to send files from client to server as blocks.
for eg, i want to send 10kb file means,i will send like 1kb files.
so, i heve 1 structure named as block.
how can i implement this code.can u anybody help this..
Thanks in advance,
Rathipriya.
Rathipriya
|
|
|
|
|
a FTP client for console already exists!
Don't try it, just do it!
|
|
|
|
|
Hello All
I have a small DialogApp(mfc). when I compiled it with vc7, the exe runs fine on NT4, Win2k and XP, but when trying to run it on Win98, Win98 kept saying that the exe image is corrupted. I wonder if anyone've seen the problem and know why?
PS. mfc and CRT is statically linked into the exe.
|
|
|
|
|
normally its the other way round.. but 98 suxx indeed
Don't try it, just do it!
|
|
|
|