Click here to Skip to main content
       

C / C++ / MFC

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
AnswerRe: Memory usagememberDavidCrow16 Nov '12 - 2:27 
See here.

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous


AnswerRe: Memory usagememberRolf Kristensen16 Nov '12 - 3:30 
CString csMsg;
PROCESS_MEMORY_COUNTERS_EX procMemInfo = {0};
procMemInfo.cb = sizeof(procMemInfo);
if (GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&procMemInfo, sizeof(procMemInfo)))
{
	// Log how much physical and total memory we are using
	// - Win7 (and newer) reports commit-size in this member
	if (procMemInfo.PagefileUsage==0)
		procMemInfo.PagefileUsage = procMemInfo.PrivateUsage;
	ULONG ulWorkingSetSize = (ULONG)(procMemInfo.WorkingSetSize / 1024 / 1024);
	ULONG ulPagefileUsage = (ULONG)(procMemInfo.PagefileUsage / 1024 / 1024);
	CString csProcessMemInfo;
	csProcessMemInfo.Format(_T("WorkingSetSize=%lu MBytes, CommitChargeSize=%lu MBytes"), ulWorkingSetSize, ulPagefileUsage);
	csMsg += csProcessMemInfo;
}
MEMORYSTATUSEX memStatus = {0};
memStatus.dwLength = sizeof(memStatus);
if (GlobalMemoryStatusEx(&memStatus))
{
	// Log how much address space we are using (detect memory fragmentation)
	ULONG ulUsedVirtual = (ULONG)((memStatus.ullTotalVirtual-memStatus.ullAvailVirtual) / 1024 / 1024);
	ULONG ulAvailVirtual = (ULONG)(memStatus.ullAvailVirtual / 1024 / 1024);
	CString csMemStatus;
	csMemStatus.Format(_T("UsedVirtual=%lu MBytes, AvailableVirtual=%lu MBytes"), ulUsedVirtual, ulAvailVirtual);
	csMsg += csMemStatus;
}

AnswerRe: Memory usagememberArun S J18 Nov '12 - 18:13 
Use the API GetProcessMemoryInfo()
Questioninterp project in 64bit systemmemberDang Vu Tuan15 Nov '12 - 21:46 
I have building xll addin for excel by VC in 32bit system as following: http://www.codeproject.com/Articles/5263/Sample-Excel-Function-Add-in-in-C
 
Now I'm using 64 bit system, I have try to rebuild it in 64bit system: I using 32 bit code, change Platform from 32bit to 64 bit in Configuration Manager

When I build, it is Failed:
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(E:\Programming\interp_src\Debug\Interp32.dll) does not match the Linker's OutputFile property value (E:\Programming\interp_src\Interp32.xll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile property value (.xll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>.\Release/Generic.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
1>
1>Build FAILED.
 

Please help me, how can I build this xll in 64 bit system?
(I using W7-64bit, Excel 2010-64bit and VS2010)
 
Thank for helping!
AnswerRe: interp project in 64bit systemmvpRichard MacCutchan15 Nov '12 - 23:57 
It looks like you may be trying to build a mixture of 32 and 64 bit items. However, since this is connected to a CodeProject article you may get a better answer by using the forum at the end of the article to communicate with the author.
One of these days I'm going to think of a really clever signature.

QuestionSql server Database BackUpmembershibashish mohanty15 Nov '12 - 20:06 
I want to take backup of my server database into my local system.so i have used the following sql query
 
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
 

-- specify database backup directory
SET @path = 'C:\Backup\'
 

-- specify filename format
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
 

DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name IN ('Sutra') -- exclude these databases
 

OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
 

WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName
 

FETCH NEXT FROM db_cursor INTO @name
END
 

CLOSE db_cursor
DEALLOCATE db_cursor
 
i have created the Backup folder in C: drive.but it returns the following error
 
Msg 3201, Level 16, State 1, Line 28
Cannot open backup device 'C:\Backup\Sutra_20121116.BAK'. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 28
BACKUP DATABASE is terminating abnormally.
 
Please solve it.Thanks in advance
shibashish mohanty

AnswerRe: Sql server Database BackUpmvpRichard MacCutchan15 Nov '12 - 23:55 
Does this have something to do with C++?
One of these days I'm going to think of a really clever signature.

AnswerRe: Sql server Database BackUpmemberAndré Kraak16 Nov '12 - 0:48 
As mentioned in this article: http://blog.sqlauthority.com/2011/12/17/sql-server-fix-error-msg-3201-level-16-cannot-open-backup-device-operating-system-error-3-the-system-cannot-find-the-path-specified/[^] did you create the backup folder on the machine where the SQL instance is running on or on the machine where you are running the script?
It should be created on the machine where the instance is running on.
0100000101101110011001000111001011101001

QuestionNeed help compilingmemberxLeonx15 Nov '12 - 8:51 
Hello i believe i have the source code for my program i developed but i am having trouble compiling it. Any help would greatly be appreciated thanks Leon WTF | :WTF:
AnswerRe: Need help compilingmemberjeron115 Nov '12 - 9:51 
See here first.[^]

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid