|
gunnar66 wrote:
It seems like my exe prog. have a memory leak problem.
How do you know this?
Are you allocating memory for filnavn1 and filnavnhtml ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
In the CE panel the used memory is growing when my exe prog is running.
I am not allocating any memory for filnavn1 and filnavnhtml
|
|
|
|
|
gunnar66 wrote:
I am not allocating any memory for filnavn1 and filnavnhtml
They are declared as pointers. Shouldn't you be allocating memory for them like:
TCHAR *filnavn1 = new TCHAR[some_size];
...
delete [] filnavn1; Or since they are used for filename purposes, you could just use a stack-based buffer of size MAX_PATH like:
TCHAR filnavn1[MAX_PATH];
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i m trying to convert bitstream file to .MPEG or .AVI ... how can i do that? anybody help me plz ...
pradeep
|
|
|
|
|
I coded a MFC DLL that acts itself as client for some COM server. When I use this MFC DLL within a
MFC application all is running fine. But when using the DLL from within an win32 (with MFC support) console application, I face the runtime error "CoInitialize not called". After that i added a "CoInitialized" call at the start of the win32 application. But then I face a memory access error.
-section of MFC DLL function to call
TaiPanClient* TaiPanClient::create(){
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
COleException *e = new COleException();
TaiPanClient *_client = NULL;
//do initialized ole support
if(!isOleInitialized){
if(!AfxOleInit()){
cerr << "[error] " << "OLE 2.0 Automation Initilization failed" << endl;
return _client;
}
isOleInitialized = true;
}
//check whether we can get an application handle
try{
ITaiPan *app = new ITaiPan();
if( app->CreateDispatch( APPLICATION_HANDLE ,e ) == TRUE ) {
_client = new TaiPanClient((void*) app);
} else {
cerr << "[error] " << "Cannot attach to COM Server, Version Independent Prog ID TaiPan.Anwendung" << endl;
throw e;
}
} catch(COleException *e){
char str[1000];
e->GetErrorMessage(&str[0], 1000);
cout << "exception thrown " << &str[0] <
|
|
|
|
|
I want to understand the knowledge of Encode amd Decode,
could you give me some?
Thanks !
|
|
|
|
|
Encode goes from A to B. Decode comes back.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Encode, or encrypt, means to convert data or some physical quantity into a given format (e.g., ROT-13). Decode, or decrypt, means to convert code into ordinary language.
For example, before you send a password to someone via e-mail, you would first encrypt it so that it is not easily readable. When the recipient opens your e-mail, they would need to decrypt the password before being able to use it. If my password was saturday and I encrypted it using ROT-13, the result would be fngheqnl.
Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How to implement a C++ application on my website?
|
|
|
|
|
Can you explain your question little more??
what do u want use c++ to write webpages or C++ application run on your webpages to perform some task
|
|
|
|
|
Can you explain your question little more??
what do u want use c++ to write webpages or C++ application run on your webpages to perform some task
|
|
|
|
|
You can use C++ to write ISAPI extension DLL's which can dynamically write out HTML code for you. You have to change some settings in your IIS, but after you get the hang of it, I think it'll be pretty easy. I did a couple of examples from a book published by SAMS called 'Visual C++ 6 Unleashed'. there's some good examples in there that show you just what to do so that you can just about do your whole website in C++.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Hi,
I'm writing an application that helps the user create dial up
connection with some special settings. The problem is that I am using
my own wizard and I need to make it possible for the user to make the
connection private, i.e. setting the owner of the connection to the
user in question. This function should behave in the same way as when
setting "For my use only" in the standard windows wizard. Which API
should I use? Is it the Authorization API, or is there a function in
the RAS API?
|
|
|
|
|
Hi all,
I'm having a frame in a dialog box and I'd like to distribute N rectangles within it in most approprate manner. I'm looking for an algorithm to help me calculate the positions where I should draw the N rectangles.
Any suggestion would be appreciated.
|
|
|
|
|
I think you'll have to elaborate a little more.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Sorry! I had forgotten to include the description
I have a frame in a dialog box and I'd like to distribute N rectangles within it in most approprate manner. I mean in a way that it look like they've been put around some circles not just one circle.
|
|
|
|
|
Sorry! I had forgotten to include the description
I have a frame in a dialog box and I'd like to distribute N rectangles within it in most approprate manner. I mean in a way that it look like they'ven been put around some circles not just one circle.
|
|
|
|
|
Hi,
I have a service (written in C++), running under Windows NT/2K/XP/2003. I need to get the name of the currently logged in user, but most Windows APIs I have found return the username of the *calling thread*, which when run as a system, is always "SYSTEM".
I have tried these APIs so far:
GetUserName()
GetUserNameEx()
Unfortunately, all of the above return the username "SYSTEM". Any suggestions?
This code needs to run on Windows NT, 2000, XP and 2003.
Advance thanks ,
|
|
|
|
|
Hi,
you can try to access the windows register at
\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
and catch the value of Logon User Name key.
To do this use:
HKEY masterKey = HKEY_CURRENT_USER;
CString SubKey = "\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer";
HKEY hKey;
if (RegOpenKey(masterKey,SubKey,&hKey) == ERROR_SUCCESS)
char ValueName[1024]="";
DWORD dwValueNameSize=sizeof(ValueName);
DWORD dwType=REG_NONE;
BYTE Data[1024]="";
DWORD dwDataSize=sizeof(Data);
while (strcmpi(ValueName,"Logon User Name") != 0)
{
LONG Result=RegEnumValue(hKey, dwIndex, ValueName,
&dwValueNameSize, 0, &dwType, Data, &dwDataSize);
dwIndex++;
}
---
You will get the user logon on ValueName string
For furhter details see also
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumvalue.asp
|
|
|
|
|
vilmer wrote:
you can try to access the windows register at
\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
and catch the value of Logon User Name key.
Your Approch is right,but from the service this approach is wrong.if you try to open HKEY_CURRENT_USER from service instead of opening of that it open HKEY_USER/.Default. you can try. because sevices start before logon,on logon OS decide which is current user whihc registry setting he is going to use.
now question arise how to open the current user from service
solution is right there HKEY_USERS\{Current Logon USER SID}\ is TRUE replica for HKEY_CURRENT_USER
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
vilmer wrote:
you can try to access the windows register at
\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
and catch the value of Logon User Name key.
Your Approch is right,but from the service this approach is wrong.if you try to open HKEY_CURRENT_USER from service instead of opening of that it open HKEY_USER/.Default. you can try. because sevices start before logon,on logon OS decide which is current user whihc registry setting he is going to use.
now question arise how to open the current user from service
solution is right there HKEY_USERS\{Current Logon USER SID}\ is TRUE replica for HKEY_CURRENT_USER
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
i have a suggestion.
u can write a WinLogon.dll for knwoning this.
to known more about winlogon dll ,there is nicely written article in MFC/C++/System Section over it.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
e_prabhu wrote:
I have a service (written in C++), running under Windows NT/2K/XP/2003. I need to get the name of the currently logged in user
I assume you know that a service can make no assumptions about whether a user is logged in or not.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
Hi all,
I am sorry if this is a stupid question.
I would like to write a application using vc++.
Can I do some thing in my application which restricts the user to install or uninstall any application/ software from the system . I know about failing a write or create operation . But that I guess will be a disaster.
So could it be some thing like we have some process or thread which is only used for installations and uninstallations- and I fail that.
Any ideas ??
Thanks in advance.
rajesh
|
|
|
|