|
I installed VS 2005 Pro on a new machine and went to debug an existing application. The ADO calls to query the SQL server DB are taking a REALLY long time, where they run instantly on the old installs. Are there any global settings that will change the debugger performance? I have all the patches installed, right data sources, same connection string, etc. but it won't run quickly.
|
|
|
|
|
Hi all
I am copy file data from source to destination.It is working only for .txt file.Code is here
USES_CONVERSION;
CString FileName;
CString cs;
CString CStrfilename=FileName;
char* charfilename;
charfilename=CStrfilename.GetBuffer();
LPCTSTR lp;
lp=CStrfilename;
PathSkipRoot(lp);
cs = "\\BackUp\\";
cs += PathSkipRoot(lp);
CopyFile(FileName, cs,TRUE);
But when i use
AfxMessageBox(cs) then it is working for .exe. So can any one tell me where i am wrong?
Plz help me
|
|
|
|
|
|
vcprog wrote: I am copy file data from source to destination.It is working only for .txt file
What happens with other file types?
vcprog wrote: CopyFile(FileName, cs,TRUE);
Why don't you check the return value (and call GetLastError on failure?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What happens with other file types?
.txt,.doc is copy successfully. And other file is not copy..
Plz help me
|
|
|
|
|
What about my second question (i.e. did you check CopyFile return value? Did you call GetLastError on failure?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
When i am useing GetLastError then i am geting Assertion fail..
File f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\appui1.cpp
Line 163
Plz help me
|
|
|
|
|
Actually GetLastError returns a number.
Please post the code wherein the error occurs and report the error exactly as it stands.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
USES_CONVERSION;
CString FileName;
cs;
CString CStrfilename=FileName;
char* charfilename;
charfilename=CStrfilename.GetBuffer();
LPCTSTR lp;
lp=CStrfilename;
PathSkipRoot(lp);
cs = "\\BackUp\\";
cs += PathSkipRoot(lp);
DWORD dwError = GetLastError();
CopyFile(FileName, cs,TRUE);
AfxMessageBox(dwError);
|
|
|
|
|
vcprog wrote: DWORD dwError = GetLastError();
You should call this after
vcprog wrote: CopyFile(FileName, cs,TRUE);
And then check error code why Copy fails??
Is it right?
Regards,
Sandip.
|
|
|
|
|
vcprog wrote: // CopyFile(st, cs,TRUE); DWORD dwError = GetLastError(); CopyFile(FileName, cs,TRUE); AfxMessageBox(dwError);
Please replace the above sequence with the following
if ( CopyFile(FileName, cs, TRUE) != TRUE)
{
DWORD dwError = GetLastError();
CString szMsg;
szMsg.Format("Error number %d", dwError);
AfxMessageBox(szMsg);
}
else
{
AfxMessageBox("Success");
}
and post the output.
<div class="ForumSig"><small>If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.<br>
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
</br></small><small><a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=1778670">[My articles]</a></small></div>
|
|
|
|
|
Error no. 32 for .exe file and Error no. 3 for .txt file. But .txt file is copy file is Success.
Plz help me
|
|
|
|
|
haha~ The error number is exactly the same as that we have expected.
Click Tools >> error Lookup,enter the error number,
then you may have the answer.
You know some birds are not meant to be caged, their feathers are just too bright.
|
|
|
|
|
thx's for reply..
Error is
The process cannot access the file because it is being used by another process.
Plz help me
|
|
|
|
|
i find your problem is not to programe,is to use the computer.
You know some birds are not meant to be caged, their feathers are just too bright.
|
|
|
|
|
from WinError.h
#define ERROR_PATH_NOT_FOUND 3L
and
#define ERROR_SHARING_VIOLATION 32L
I think they're quite explanatory.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
cpallini wrote: Please post the code wherein the error occurs and report the error exactly as it stands.
vcprog wrote: DWORD dwError = GetLastError();
CopyFile(FileName, cs,TRUE);
AfxMessageBox(dwError);
Aye, aye, aye! As stated above, GetLastError returns an integer. You then need to use this integer IN CONJUNCTION WITH FormatMessage to get a printable text string. If you have a look here, you can see an example of use for the two functions:
http://msdn.microsoft.com/en-us/library/ms680582(VS.85).aspx[^]
We will "please help", so long as you will "please read".....
|
|
|
|
|
I am working in XP, Visual C++ v6 doing maintenance on existing report preparing codes. I am new to C++ language and to C/C++ programming. I have a linking error and would appreciate some expert help.
error mssges:
:\Documents and Settings\IVarma\Desktop\kunda\Modcode.cpp(916) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Linking...
Modcode.obj : error LNK2001: unresolved external symbol "int __cdecl open_cluster(void)" (?open_cluster@@YAHXZ)
Modcode.obj : error LNK2001: unresolved external symbol _BTRV@24
Modcode.obj : error LNK2001: unresolved external symbol "char * dbpath" (?dbpath@@3PADA)
Modcode.obj : error LNK2001: unresolved external symbol _fatal
Modcode.obj : error LNK2001: unresolved external symbol _set_multi_defaults
Modcode.obj : error LNK2001: unresolved external symbol "char * __cdecl get_option(void)" (?get_option@@YAPADXZ)
Modcode.obj : error LNK2001: unresolved external symbol "int __cdecl new_decode_cluster(char *,char (* const)[4][100])" (?new_decode_cluster@@YAHPADQAY13GE@D@Z)
Debug/Modcode.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.
|
|
|
|
|
Warning
1) change main(????? to int main(?????
Errors
2) Add the lib file that contains open_cluster, _BTRV, dbpath, _fatal, _set_multi_defaults get_option and new_decode_cluster to project in the build (linker) options.
|
|
|
|
|
I tried taking the .cpp file that I wrote it in and adding that to my project file list. I also put #include "stdafx.h" in the header of my .cpp program. When I build/compile the .exe Project file it says no errors, but when I try to execute it, nothing comes up on screen. Should I be linking the .cpp program file into another Project File(using Public)? Maybe there are too many Source files now that I added my .cpp program to the source file list? Maybe it is not possible to incorporate a QuickWin.exe program into a Windows App. Project? My books do not tell me how to do this. Can I just copy and paste the code into the Project .CPP file? Any help thanks.
|
|
|
|
|
JFSabastian wrote: ...when I try to execute it, nothing comes up on screen.
As opposed to what?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
What I should come up on the screen is a spreadsheet grid from the Project code and then I was hoping my program would run and ask the user a series of questions, it is a series of questions and numerical answers. Then it asks the user if he wants to quit the program and it exits. Both the spreadsheet grid(AppStudio) and the ABV.CPP program were created in Visual C++, but the spreadsheet grid is a Project and the ABV.CPP is a C++ program I wrote. I just want to incorporate that C++ program into the Spreadsheet Grid Project so I can show the user his data and maybe a chart. I would also like to have dialog created in AppStudio as opposed to my MSDOS black screen, white letters ABV.CPP program. Is that possible? Could I cut and paste my code into the project somehow or can I simply link the program to the project?
|
|
|
|
|
JFSabastian wrote: What I should come up on the screen is a spreadsheet grid
Using printf() , cout , or something else?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I am trying to create a console program that uses MFC framework. More specifically.
1. The user would input commands/options/etc. into the console. Essentially a shell.
2. The shell will parse the command and send the information to a dll I wrote that will format the command and send to an external hardware.
3. The hardware does whatever and sends result/update, which is received by another thread and the message is formatted and sent up to a pipe.
4. I first wanted to use another console screen to display the message from the pipe, but I found out an application can't have more than 1 console screen. So I decided to use MFC to create a window to simply display the message. I have a class derived from CWinThread to do this, but I am not sure how to tie in the frame/document/view without using the document template. All the MFC documentation/references all state that I need to use document template, but since AddDocTemplate is member of CWinApp not CWinThread I am not certain how I can associate frame/view/document.
I am using VC++ 6.0 so I guess that means I am using MFC 6.0
Is what I am trying to do not possible? and should I try a different route like creating a separate application to display the messages on the pipe?
Thanks for any help.
|
|
|
|