|
Branislav wrote:
I would add also
sFileContent=(char *)malloc(BufferSize+1);
That's what the part reading "To be able to do this you must first allocate one byte more than the filesize" was intended for.
Though one would never have to work this hard using C++:
std::ifstream foo("filename");
std::string bar;
foo >> bar;
if (!foo.fail()) {
MessageBox(NULL,bar.c_str(),"value",MB_OK);
}
|
|
|
|
|
Hi friends,
I built an MFC project in win98 machine, vc6.0. I could run my program. Now I want to run this program in another machine without loading VC++ in that. What I did I copied the necessary dlls into that system manually and tried to run my exe. I am getting this error: "The xxx.exe file is linked to missing export:MSVCRTD.DLL:chkesp" and "A device attached to the system is not functioning". What does it mean? can anybody help me? Thanks;
satya
|
|
|
|
|
You are trying to run a debug build. You are legally not allowed to redistribute msvcrtd.dll, and therefore can't really distribute a debug build unless you link statically to the CRT (libcd.lib).
|
|
|
|
|
hi,
Basically, this error means that something looking for
of MSVCRTD.DLL (the MicroSoft Visual C RunTime Dynamic
Link Library) is finding a different (probably older) version/ or it is absent. The version it is finding does not have the all the exports (places that things calling the DLL can enter by) that the version it wants has.
Regards,
Sharad Ganesh
|
|
|
|
|
Hi everyone. I recently wrote a program which saves data into a CSV (comma separated value) file. I searched and was unable to find the exact specifications for the format. Since each data string is surrounded in quotes in the file itself, how do I handle quotes in the data string itself? Do I leave them, and only change the commas between quotes, which signify a break between strings? And if I change them, what do I change them to? One CSV file I downloaded had the quotes in the strings changed to %22's. Anybody know more or where I can find more info, so my CSV is compatible with other programs which may read it?
|
|
|
|
|
www.wotsit.org[^]
HTH
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Turns out one doubles up quotes within the data string. Thanks for the link!
|
|
|
|
|
1) is it good practice, or even possible, to have one class factory produce instances of many different COM classes?
i'm trying to make a scripting engine using IActiveScript and such, but i have multiple COM classes implementing IActiveScript, IActiveScriptSite, etc... but I don't want to have a class factory for each one
any thoughts?
2) example: a IActiveScriptError pointer gets passed to the OnScriptError function of an IActiveScriptSite... should the function call the script error pointer's Release method or is that not necessary?
- Roman -
|
|
|
|
|
Q2. [in] parameter must be never released in the called function.
With best wishes,
Vita
|
|
|
|
|
If you are using Norton Anti-Virus 2001/2002, and your operating system is Windows 2000 or Windows Xp, and your programming IDE is Visual C++ 6.0, please be warned that you might lose your hard work with a mysterious reason.
Usually, if you are using above listed products together, you will frequently get this error message while programming, "Cannot save file, the file is being used by other applications.".
It is OK if it happens when you are on the code editor, it can be solved by simply save the file again, so it dosen't hurt much, although annoying.
But, a big BUT here, if at the exact moment you are using class wizard, one of your files will be permanently deleted by Norton Anti-Virus from your disk, it could be either the .h or .cpp of the class you were manipulating using class wizard, usually the .cpp. That deletion is permanent, there is absolutely no way to recover that file from disk. If you close Visual C++ now, you lose that file forever, it could be a project that you've been working on for weeks.
Solutions? Well, there are a few, from my personal experiences:
1, Once that happens, calm down. Firstly check on hard disk see if the file is deleted, if it is, immediately use your Visual C++'s "File view" feature and find that file in file list, that is possible because Visual C++ keeps files in memory event after they're deleted from disk, unless it requires the memory space for something else. If the file still exists in "file view", open it, copy all source code to clip-board, create a new file on disk and paste the contents from clip-board, congratulations, it's back.
2, Do not use Norton Anti-Virus on Windows 2000 or Windows Xp. The bug does not exist on Windows 98/ME.
3, Well, this is my personal opinion and CodeProject.com does not hold and responsibility for this, simply stay away from Norton Anti-Virus. And no, turning "Auto protect" off does NOT help.
Hope this info helps.
|
|
|
|
|
don't scare me, i don't use Norton.
don't scare urself, u made a mistake obviously:
if a file is deleted from disk, u can't recorver it by 'file view'. info for 'file view' is in file '*.dsp', not in memory, and only with file name, not file content.
don't argue with me now: delete a file manuely then try recorver it ...
includeh10
|
|
|
|
|
includeh10 wrote:
i don't use Norton
then you don't know what you're talking about, in this case.
this exact situation has happened to me a number of times. NAV and ClassWizard / ATL Wizard / etc will sometimes collide and the files that were being edited by VC get truncated to zero bytes. luckily, i've always been able to find the temp files in my system temp folder that VC was using for my source files. i'm not 100% sure i'll always be so lucky. yes, i've told NAV to ignore .CPP and .H files.
i am constantly getting that "current file is being used by another application" message. like, 1/3 of every time i have to build.
NAV + VC + 2K is risky.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
I wish you have tested what you said... Anyway, open a project, open a source file use file view(so make sure that file is loaded into memory by VC++), then delete that file from disk manually, now back to file view and see that file and all its contents are still there, you can copy them to clipboard.
Anyway, if you never encountered the problem then good, really good because it's not a good thing to lose a source file that you've spent hours on. But I know it's not only me that had the problem so I just wanted to warn others who could potentially lose their works.
|
|
|
|
|
if you never encountered the problem then good, really good because it's not a good thing to lose a source file that you've spent hours on. But I know it's not only me that had the problem so I just wanted to warn others who could potentially lose their works.
thankx a lot....now we can notice the situaion even i dunno use the same config...oherwise all of the peoples here waste their time and fill up the Codeproject discussionboards with that problem...here someone try to argue with u..but they dunno lok on the actual problem...if it really happen try to findout some solutions...PLEASE dont fight here...
Renjith-CPian.
|
|
|
|
|
I am running win2000, Norton AV 8.0 (2002) and C++ 6.0 and never had a problem like that. Maybe it is a different version of AV? Or a WinXP issue? That does sound very serious, I hope Norton or MS addresses that.
|
|
|
|
|
YES, this is the exact problem i've been having for years and it deleted one of the CPP files of my project! annoying, but eh, oh well... i'd probably never finish it anyway
so i switched to .NET and so far I haven't gotten that error
- Roman -
|
|
|
|
|
I wonder if any of what you have described have happened to Michael Dunn while we was working for them
Best regards,
Alexandru Savescu
|
|
|
|
|
Yeah. I use Norton 2003, XPPro, and VC6, and I get the first problem (the cannot save dialog) all the time.
Do you, by any chance, know how to stop that error, short of uninstalling Norton?
|
|
|
|
|
i downloaded SCBDemo3, a sample or library of dockable window.
in my program, i modified it, but i meet unknown trouble with it. please help ....
first, create a sub-class of the dockable window (called XDock).
then add a CView's sub-class (called XView) as its content (or RUNTIME CLASS, or child), then add 3 CTreeCtrl's sub-class (called XTree) as children of XView.
then add some tree items on WM_CREATE message of XTree(OnCreate) to each tree.
------------ so far so good. but problem comes now:
i can not add a tree item out of XDock !
code is simplified as:
class XView:public CView
{.........
CTreeCtrl tree0,tree1,tree2;
.........
};
XDock dock;
dock.Create(this,RUNTIME_CLASS(XView),....
//tree0,1,2 are created inside XView
//add tree items inside tree0, OK
problem is add tree item out of dock as following:
XView*pv=(XView*)dock.GetWindow(GW_CHILD);
pv->tree0.AddTreeItem("some name");//a. retuen 0.
BOOL XTree::AddTreeItem(CString cs)
{
HTREEITEM hNew=InsertItem(........);//b. hNew is 0
......
};
note: as i said, if inside XTree, it is OK
BOOL XTree::OnCreate(...)
{..............
AddTreeItem("it is OK here");
}
i checked both a. and b. are called, why calling inside XTree is OK, outside is failed?
i'm waiting for u and prepare more hints as required.
thx
includeh10
|
|
|
|
|
My Project:
To prepare a master data file from numerous text files (3,00 to 8,000).
Each file has a unique name.
The first line of each file is NOT a header file.
- The first line of each file needs to be concantonated to each of the following lines of the respective file.
- Then the first line needs to be deleted
Then the file needs to be appended to a master file.
I want to auto mate this process to automatically perform this to all the files selected ( all the selected file will be in one directory)
Okay, I started this project in MS ACCESS but I can only process one file at a time. So I thought I would dabble with trying to figure this out in a programming language. I am vaugley familiar with VB and intermediate (or a bit less) using BASIC. Any help would be appreciated.
Fred
|
|
|
|
|
This is a snap using iostreams in C++, but based on what you've said, I'm not sure that there is any starting point from which to discuss it. Have you used C++ before ? If not, why are you posting to a C++ forum ?
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I have the following problem. I want to use WinNT functions in a program that should work on Win9x too. I have a single .exe. I check the OS version before calling the NT only functions but when I try to run the program under Win9x it get an error that the .exe is linked to a missing export in user32.dll.
I am relatively new to Windows and this is the first program I'm trying to do Win9x compatable.
Do you have any idea what do I miss?
With the new unicows.dll I should even be able to write a single UNICODE application for Win9x and WinNT.
|
|
|
|
|
You need to delay load the dll that has the function you only have available in NT, otherwise it will not run, even if it's not getting called in 9x. I forget how, but it's in the MSDN.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Christian Graus wrote:
You need to delay load the dll
... or call GetProcAddress for the "extended" functions.
|
|
|
|
|
In the MSVC documentation, SetActivateWindow() activates a window - however this must be associated with the calling thread's message queue. Is there a way that I can pass control from my program to another app's main window knowing it's handle ?? (I have got the handle using EnumWindows() and checking the window title). Appreciate any help
Doug
|
|
|
|
|