|
In VS.NET 2003, go to Tools, Options, Text Editor, C/C++, and check the "Enter outlining mode when files open" box.
Software Zen: delete this;
|
|
|
|
|
when I Init the AcDbDatabase class
AcDbDatabase* db = new AcDbDatabase(Adesk::kFalse, Adesk::kTrue );
db = NULL;
I get a heaperrorafter init'ing the AcDbDatabase object.
any takers on why?
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
lets run a dos window (command.com) then type "sort" (then press return key).
the dos window blocks there (until we input complete command for "sort").
at this stage, can we terminate the "sort" command or exit dos window without pressing close button of the dos window? - i mean, terminate the dos window only by tying some command ot text?
================================================
this is a VC question actually.
I use an app to CreateProcess of the command.com.
but once the dos blocks there (i.e. in the middle of sending command "sort"), my app can not terminate the dos window - i have tried all functions (such as TerminateProcess, RxitProcess).
i think if i can terminate the dos by command as described above, i can terminate the dos in my app also.
thx
includeh10
|
|
|
|
|
when u use createprocess to run command.exe are u using the process handle in the return PROCESS_INFORMATION structure to TerminateProcess() ?
also sort.exe is another app which is spawned by command.exe, so TerminateProcess() doesnt hav the process handle of sort.exe it only has command.exe.
maybe try using createprocess to run sort.exe instead?
|
|
|
|
|
When I run my VC++ program (both Console and Windows version), I noticed that the "Mem Usage" (under Processes in the Windows Task Manager) ALWAYS increases by 4K every time my program executes. Is this normal? I didnt use any dynamic memory creation (using "new"), but can this be a memory leak?
I let the program sleep using "Sleep(xxx), and I use FileMappingObject... Can this be the reason??
Rihannsu
|
|
|
|
|
Your program's private bytes would be cleaned up upon exit anyway. You should see what your program does. Maybe you leaked some system resource or other shared resource, which might not get recovered until the system restarts.
|
|
|
|
|
The program will be running for weeks on end. Also, I use FileMappingObject every time the program runs (in this case, every 2 seconds). Every time this happens, it increases by 4k. Can this be related to opening files, or using FMO??
Thanks!
Rihannsu
|
|
|
|
|
You need to UnmapViewOfFile those FMO when you are done. Also make sure to CloseHandle the FMO's 'file' handle after unmapping the view to it. There is no reason you could not run 'indefinitely' if the proper cleanup is performed.
We use FMO in our apps, and our apps run for months at a time.
|
|
|
|
|
I am writing a c++ program to encrypt/decrypt files. my instructor wants to start this program by right clicking on the file to be encrypted/decrypted and then choosing the option Encrypt/Decrypt among the list that appears when any file is right-clicked. Can anyone help me with that?
|
|
|
|
|
|
Meaning you probably need a context menu handler that responds to all file selections.
Selection of items from the context menu will invoke your program to encrypt/decrypt the selected file(s).
|
|
|
|
|
Thank you. This is exactly what i was looking for
|
|
|
|
|
Hi,
I want to send an email through my VC++ app with out anyone knowing( in the back ground). We have Lotus notes as the email client. Can anyone please suggest How to do this? Thanks a Lot!
Murthy
|
|
|
|
|
okay...i have written a program that calculates prime number till u stop the program. Now, what happens it that while calculating the numbers or calculating any mathematical equation for that matter, the program only manages to use a small portion of the CPU. How can i utilize the whole CPU. SOmething like multithreading. In basic terms, i want to calculate the number as fast as possible!!
|
|
|
|
|
What is it your program does that it does not consume more CPU time? If you had a tight loop performing only math, then your program should be using a LOT of the CPU time as the foreground process. In this case it does not make sense to split into multiple threads, you would just be wasting more time switching the context. Do you output to screen or wait for user or something? Typically you only multiple thread if you need to handle user input while calculating something, or your program responds to user input while checking mail, or waiting for characters from the modem, or reading and writing to the files on the hard drive or something else like that, where there are distinct different actions, some of which involve 'waiting' for soemthing. Your program seems very straight forward and should probably remain single threaded.
|
|
|
|
|
yeah, youre right. In a tight loop it does use all of the CPU.
|
|
|
|
|
Check out SetThreadPriority()
"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
|
|
|
|
|
Hi
I am downloading some files from FTP server through a VC++ app. I need to display progress bar ( possibly standard windows dialog for copying showing the progress ) Can anyone point me to the right classes, sample code, or give some suggestions? Any help is greatly appreciated. Thanks in Advance!!
Murthy
|
|
|
|
|
Iam not sure what you want here ...
1.If you want to display the progres s,then u can use progress control .CProgressCtrl is the class.
2.CFtpConnection is teh class for FTP
Cause is my effort;
Effect is God's effort
|
|
|
|
|
|
I don't know where should i place this topic (databases or here)... whatever
My question is...
Is there any way to create function that can return a recordset? i tried to do it but...
i forgot... the other thing is how to "catch" returned recordset? does CRecordset have any copy constructor or sth?
any ideas? please .
|
|
|
|
|
scoroop wrote:
Is there any way to create function that can return a recordset? i tried to do it but...
But what? Show us the code that you had/have and what the problem is.
scoroop wrote:
does CRecordset have any copy constructor...
No.
scoroop wrote:
does CRecordset have any...sth?
What is sth?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
first of all ... what is sth? in every english/foreign language dictionary they use "sth" instead of "something" .
ok and now straight to the point:
i need a function that queries database and that returns results as CRecordset:
<br />
CRecordset* CDB::Query(CString path, CString SQLstring)<br />
{<br />
...some declarations... <br />
<br />
TRY <br />
{<br />
...i open database and then:<br />
<br />
CRecordset* recset = new CRecordset(&db);<br />
recset.Open(CRecordset::forwardOnly, SQLstring, CRecordset::readOnly);<br />
return recset; <br />
db.Close();<br />
}<br />
CATCH(CDBException, dbex)<br />
{<br />
AfxMessageBox("Error: " + dbex->m_strError);<br />
}<br />
END_CATCH;<br />
}<br />
Than in the other class i'd like to use it...
<br />
CDB d;<br />
CRecordset *recset = d.Query(path,sqlstring);<br />
the result is that program compiles, when i run procedure form the second code snippet it's fine but recordset is "poisoned" . when i use any method of CRecordset class i get "debug assertion failed" error. i'm not too good in pointer stuff so it's quite possible it's something trivial .
|
|
|
|
|
scoroop wrote:
in every english/foreign language dictionary they use "sth" instead of "something"
Not in any dictionary that I have ever owned or used. That must be one of those online-specific things where folks type r instead of are and ur instead your.
scoroop wrote:
db.Close();
Why are you closing the database?
scoroop wrote:
when i use any method of CRecordset class i get "debug assertion failed" error.
It would help if you indicated what line of what file fired the assertion.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Not in any dictionary that I have ever owned or used. That must be one of those online-specific things where folks type r instead of are and ur instead your.
not at all... i have oxford collocations dictionary and collins dictionary... they use it as well. check it and you'll see it's quite common .
Why are you closing the database?
shouldn't i do it at the end of a function? if you say so, i assume that returned recordset passed to another function will need access to db. anyway i don't close db now but the result is the same...
what line of what file fired the assertion.
depends on the function that i use. when i want to browse recordset
recset->GetFieldValue(1,str);
i get error in afxdb.h line 680 and when i press retry i receive window with dbcore.cpp line 1920 (so it all stops on the method i used).
|
|
|
|