|
I am not sure if this is what you want, but:
There are numerous registry settings which you can set to lock-down a Windows 9X, NT and 2000 PC. We do this at my office to prevent users from changing their configurations. We have about 100 registry settings which we apply but we lock them down pretty tight. What you are asking for is probably just 5-10 registry settings.
If you want, I will email you the registry settings we use. (All of the settings can be found on the net, but some can be hard to find.) Send me an email at gullettm@yahoo.com.
Thanks,
Matt Gullett
|
|
|
|
|
Dear all,
I have a VC Project and I need to load html pages with images from a database (not saved in files).
I read from database the html, and using an ActiveX of HTML show it like a browser, but the images doesn't. I need some ideas of how I can show Html pages with images, the html pages are in the database, the images can be a file of the project or a register in a database.
I hope that somebody can help me to find one solution!!
Thanks to all!!
Regards,
---------------------
Pere Llibre
Software Engeneering
|
|
|
|
|
Pere_Llibre wrote:
the images can be a file of the project or a register in a database
Not that I understand what you mean by neither of these things, but if it can be stored in a database and you want a browser such as IE to access them using some path, you have to implement a filesystem driver to return them.
You could also drop this DB-server idea altogether and use a web-server. Last I checked they were actually optimized to serve HTML pages the contents they might have.
|
|
|
|
|
Hello
I'm about to implement som statistics function to my application, but I'm not really sure how to do this on a good looking way. I was trying to find som examples on the web to get some tips, but I have not found any.. Does anybody have som tips were to look ... or just some tips in generell.
Thanks
Henrik
|
|
|
|
|
|
I am having a problem when sending a command line argument while using CreateProcess(). (Both commands run fine on a dos prompt).
When I send the following command it works fine:
sprintf (cmdline, "C:\\THE PROJECT\\Interface\\mygnokii --identify");
But when I send this line I'm told that the "Process cannot be created":
sprintf (cmdline, "C:\\THE PROJECT\\Interface\\echo Test Message | mygnokii --sendsms ********");
Does anyone know why this might be happening?
Thanks.
/*************************************************************/
#include <windows.h>
#include "resource.h"
...
void CNewSMSDlg::OnNewSMSSendbtn()
{
BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
SECURITY_ATTRIBUTES sat;
PROCESS_INFORMATION pinfo;
STARTUPINFO startinfo;
HANDLE hReadPipe, hWritePipe;
char cmdline[300];
char buffer[1024];
HRESULT res;
DWORD bytesread;
sprintf (cmdline, "C:\\THE PROJECT\\Interface\\echo testing | mygnokii --sendsms ********");
// sprintf (cmdline, "C:\\THE PROJECT\\Interface\\mygnokii --identify");
sat.nLength = sizeof(SECURITY_ATTRIBUTES);
sat.lpSecurityDescriptor = NULL;
sat.bInheritHandle = TRUE;
res = CreatePipe(&hReadPipe, &hWritePipe, &sat, NULL);
if(res==NULL)
{
MessageBox("CreatePipeFailed", "Error", MB_OK | MB_ICONSTOP);
}
startinfo.cb = sizeof(STARTUPINFO);
GetStartupInfo(&startinfo);
startinfo.hStdError = hWritePipe; //here's where we reroute stderr
startinfo.hStdOutput = hWritePipe; //and stdout to our pipe
startinfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
startinfo.wShowWindow = SW_HIDE; //This hides the console window
res = CreateProcess(NULL, cmdline, NULL, NULL, TRUE, NULL, NULL, NULL, &startinfo, &pinfo);
if(res==NULL)
{
MessageBox("CreateProcess Failed", "Error", MB_OK | MB_ICONSTOP);
}
CloseHandle(hWritePipe);
SendDlgItemMessage(IDC_NEWSMS_EDITBOX, WM_SETTEXT, 0, 0); //clear the field
//read from the pipe using the read handle
res = ReadFile(hReadPipe, buffer, 1023, &bytesread, NULL);
if(res==NULL)
{
MessageBox("CreateRead Failed", "Error", MB_OK | MB_ICONSTOP);
exit(1);
}
else
{
SendDlgItemMessage(IDC_NEWSMS_EDITBOX, EM_SETSEL, -1, 0);
SendDlgItemMessage(IDC_NEWSMS_EDITBOX, EM_REPLACESEL, FALSE, (LPARAM)buffer);
}
CloseHandle(hReadPipe);
}
|
|
|
|
|
CreateProcess runs programs; 'echo' is not a program but a command builtin to command.com or whatever the command processor is on the version of windows you are running. So to use echo and the | pipe you need to run these through command.com
eg.
sprintf (cmdline, "command.com echo testing | mygnokii --sendsms ********");
or something like this.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
When I try this I get:
16 bit MS-DOS Subsystem
NTVDM has encountered a System Error
The Handle is invalid
Any Ideas?
Thanks,
Alan
|
|
|
|
|
If you're running NT/2K/XP the command processor is cmd.exe, otherwise it's command.com It sounds like you're running NT/2K/XP.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I put cmd.exe before the command and it did allow the process to be created, but it doesn't send the command that comes after it, because what I get back through the pipe now is:
Microsoft Windows 2000 [Version 5.00.2195]
Do you know why this is happening?
Thanks,
Alan
|
|
|
|
|
Anonymous wrote:
I put cmd.exe before the command and it did allow the process to be created, but it doesn't send the command that comes after it, because what I get back through the pipe now is:
Microsoft Windows 2000 [Version 5.00.2195]
Do you know why this is happening?
This is how cmd.exe announces itself when it starts. Try adding the "/c" switch to it. ie. "cmd.exe /c ...."
This what I do in ED for Windows (see sig) to run builtin commands. This is in ED's Tool|Build Setup which lets you run Compilers etc. and capture their output.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi,
I have a small problem regarding CObArray..
I've created a CObArray Object and i add to
it an object of my class.. (i do it in a for loop)
obIntervalTasks.Add( new CIntervalBasedTasks( "BLABLA",
24 );
Now at some instance i try to retreive it like
CIntervalBasedTasks*& temp = (CIntervalBasedTasks*&)
obIntervalTasks.ElementAt(i);
Now i do something with my object (temp)..
and then just don't want it to be deleted from Array..
and i exit from the function..
But while my application close.. i get lot of Object
Dumps.. actually these are because of hanging pointers..
temp..
How do i handle it..
Please help
Sameer
|
|
|
|
|
I might be misunderstanding something here from your question, but it seems as though the only thing missing from your application is the for loop to spin through the CObArray and delete the referenced objects. Typically, this would be done in some cleanup-type function of the appropriate class. For example, if the CObArray is in my view class, I normally place the clean-up in OnDestroy. If it's in the document, I clean up in OnCloseDocument and so on.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Hi,
I've below a small snipplet
for(int i=0;i<aintervaltasks.getsize();i++) {
="" cintervalbasedtasks*="" temp="(CIntervalBasedTasks*)" aintervaltasks.elementat(i);
="" i="" do="" some="" processing="" here
=""
}
<="" font="">
now if i delete temp then it gets
removed from the array.. I don't want that..
so how do i remove the temp.. (coz would create memory leak)
|
|
|
|
|
temp is just a pointer to an existing piece of memory. Simply don't delete it if you want to keep that piece of memory.
By creating a pointer, and assigning to that pointer a memory address, you are not creating new memory - you are just pointing to existing memory, so there is no need to call delete.
Just make sure you call delete on all the elements in the array once you have done with them
cheers,
Chris Maunder
|
|
|
|
|
I guess, this solves my problem..
but when my application exits.. it shows me
some Object Dumps. how can i come to know
which are those..
Regards
Sameer
|
|
|
|
|
Sameer Maggon wrote:
it shows me
some Object Dumps. how can i come to know
which are those..
THEY are the objects in your ObArray. You don't need to delete them when you are using them, but your REALLY want to delete them after you've finished using them.
int i = 0;
while (i < myArray.GetSize() )
{
delete myArray.GetAt( i++ );
}
myArray.RemoveAll();
cheers,
Chris Maunder
|
|
|
|
|
Sameer Maggon wrote:
now if i delete temp then it gets
removed from the array.. I don't want that..
so how do i remove the temp.. (coz would create memory leak)
1) Actually, I don't believe deleting an object removes its entry from the array. You'll need to do a RemoveAt for that to happen. Or a complete RemoveAll to dump all entries.
2) However, I don't follow your issue then. You're saying you have memory leaks because you're not freeing memory, but then say that you don't want to free memory
Simply put, you've allocated some objects in memory and placed pointers to these objects in an array (a CObArray). When you no longer need this array (such as when the containing object is being destroyed), you need to free the memory being pointed at by the array. To do that requires a simple for loop.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Hi!
what is the code to enable a disabled dialog object?
Like if I want to enable IDC_RADIO1 when someone writes in IDC_EDIT1.
|
|
|
|
|
GetDlgItem(IDC_RADIO1)->EnableWindow(TRUE)
|
|
|
|
|
I need to monitor windows with certain titles, and I want to use wildcards like "*" in expressions. How can I easy add wildcard support (may * only) in my app?
I don't need complex solutions like RegExp.
Thanks.
|
|
|
|
|
You've got a very simple wildcard matching routine in snippets.org. Go to the snippets section of that website, download the .zip file (this is seemingly the only option available, the rest of the site is under construction) and search for match.doc , match.h and match.c .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks, but I link to Zip I found there was broken.
ftp://ftp.snippets.org/snip9707.zip
Can you mail me these files or tell anothar solution?
Thanks again!
|
|
|
|
|
It ain't broken, I jues downloaded the .zip 5 minutes ago. Anyway, I've sent it to you by email.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|