|
Hello everyone,
I am in the middle of designing my first MFC application and I was wondering what I would use the windows registry for. Why would I use the windows registry? I see alot of applications enter infromation into the windows registry but I never understood why they would put it there or what they would put it there for. Can anyone help explain this to me??
Thanks in advance!
There are 10 kinds of people in this world. Those who understand binary and those who don't.
|
|
|
|
|
if you have some settings or data, that you want to store between two starts of your app, you can save it to the registry.
if you have a ListControl, you can save the size and the sort-order of the Control in the registry, so the App is more customizable for the user.
|
|
|
|
|
You could use the registry to store the last-size/position of your application and other information about it's state when it was closed.
You can save application-settings in the registry.
|
|
|
|
|
I have a tree control whose node text need to chaneg colour on selection.
|
|
|
|
|
Hello:
Anybody who can point me to a good free C++ code beautifier??
I have tried Artistic Style (astyle), but it seems to be little old and have few bugs in it.
Thanks.
|
|
|
|
|
don't understand the reason...
you don't know writing pure beautiful code??? ;P
TOXCCT >>> GEII power
|
|
|
|
|
Oh no, we are translating VB to C++, but the generated C++ code is left aligned, not indented, for loops being on 1 line...so its dirty...thats the reason we need the beautifier.
Any clue on which is a good one out on web?
|
|
|
|
|
oh, sorry now i understand... lol
hem, tell me, why don't you write a little console program that get your source, and that return you a "beautiful" code ?
it might take few lines i think...
otherwise, nop, i don't have any idea about what you're looking for.
TOXCCT >>> GEII power
|
|
|
|
|
I have used indent++ several years ago, and it was nice, although requiring some tuning. But I could not find it's home page now. But quick google bought me these links, I will appreciate, if you post results of your testing here
http://www.ochresoftware.com/sourcestyler-overview.html (not-free)
http://www.geocities.com/~starkville/main.html
http://perso.club-internet.fr/cbeaudet/
http://users.erols.com/astronaut/vim/tarfiles/ccb-1.07.tar.gz
http://www.uvm.edu/~ashawley/c/indent/
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Thanks, will take a look at the links.
But basically I need some reliable (not too old)
beautifier, which is being maintained regularly bcoz I have to ship the beautifier with my product.
|
|
|
|
|
Load the file in Visual C++ editor ver 6( i dont know about .net studio),
press ctrl^a to select all of the code, and the press
alt-F8
voila you code is beautifull.
|
|
|
|
|
VC++ ver6 wont help bcoz I need to hook up this beautifier in my project and also would need to ship it bcoz it executes in run-time.
Basically, I need something which is cheap but reliable and the software size should be relatively small.
|
|
|
|
|
Hi !
I have an Enhanced Metafile on the clipboard, which I would like to paste
into a dialog with a CRichEditCtrl....How can I do this ???
|
|
|
|
|
Hi all,
I 'm trying to establish a RPC communication using the protocol sequence
'ncacn_http' but unable to succeed. I'm already done with 'ncacn_ip_tcp'. But since 'ncacn_ip_tcp' cannot pass through a DMZ, I want to make use of HTTP communication (ncacn_http). I want to keep the RPC Server inside a DMZ (firewall) and RPC Client in the public domain. Pls reply with an example.
Thanks in advance,
Bhanu
|
|
|
|
|
I'm having trouble finding a method to automatically close and dismount a thumb drive in Windows 2K. I must automate the process such that the window dialogs don't popup. I can get it to close cleanly, but I can't the thumb drive power light to shut off to allow a clean dismount. Has anyone run into this situation?
RH
|
|
|
|
|
How to make a little pause during the running of a program?
Pause of 0.10 seconds for example.
Thank's for advance
|
|
|
|
|
use Sleep API
Sleep(100);
|
|
|
|
|
Ok thank's
But is there a function that allow to make pause only in the function it would be written.
I mean I have to let some other functions finishing before others.
With sleep, all the application is in pause.
|
|
|
|
|
No, with the sleep, this is just the current Thread that is paused. What you want is something that will 'exit' your function to enable processing of normal messages and then 'come back' at the point you left the function (it's what I've understood by your response).
The best way is to use Timers. At a point in your program, you set a timer. And when the timer fires, it will call a function and there you can continue the process.
take a look at the MSDN doc for the SetTimer function.
Hope this helps
|
|
|
|
|
When I use a breakpoint to simulate my program, I have no problems with the result. But as I run directly the program I haven't the result I hope for. So my idea is to make a pause as my breakpoint does in simulation mode. So I try to find something that can replace my breakpoint...
|
|
|
|
|
What does this function ? What are the calculations ??
Maybe if you post the code, we can help you ?
|
|
|
|
|
jeabI don't think so but here is the code:
int NumOfBlockCopied = 0;
if (lpNumberOfBytesRead == 65536)
{
CFile FileName(m_csPCFileName,CFile::modeCreate | CFile::modeWrite);
while (lpNumberOfBytesRead == 65536)
{
typedef BOOL (__cdecl *USB_ReadFile) (PVOID,DWORD,LPDWORD,ULONG);
FileName.Write(szBuf,65536);
NumOfBlockCopied ++;
lpNumberOfBytesRead = 0;
pUSB_ReadFile = (USB_ReadFile)GetProcAddress(theApp.g_hDllXtlUsb,"USB_ReadFile");
if (!pUSB_ReadFile)
{
FreeLibrary(theApp.g_hDllXtlUsb);
return FALSE;
}
else
{
BOOL BRead = TRUE;
BRead = pUSB_ReadFile((LPVOID)szBuf,nNumberOfBytesToRead, &lpNumberOfBytesRead,Timeout);
if (nNumberOfBytesToRead == 0)
return FALSE;
}
DWORD FileSizeTransfert = FileName.GetLength();
// m_progbUSBTransfert.SetPos((64/iFileSize*1000)*100);
}
m_progbUSBTransfert.SetPos(100);
}
if (theApp.m_bCommunicationMode == FALSE)
{
typedef BOOL (__cdecl *USB_CloseDevice)(); /// Close USB Communication
USB_CloseDevice pUSB_CloseDevice;
if (theApp.g_hDllXtlUsb != NULL)
{
pUSB_CloseDevice = (USB_CloseDevice)GetProcAddress(theApp.g_hDllXtlUsb,"USB_CloseDevice");
if (!pUSB_CloseDevice)
{
FreeLibrary(theApp.g_hDllXtlUsb);
return FALSE;
}
else
{
BOOL BCloseDevice = TRUE;
BCloseDevice = pUSB_CloseDevice();
}
}
}
// PESDEMUX_ProcessFile : Row File converted to Program Stream
pStatus->SetWindowText("Converting to mpg File..."); ///////////// BREAKPOINT HERE
//Sleep(2000);
m_progbUSBTransfert.SetPos(0);
typedef LONG (__cdecl *PESDEMUX_ProcessFile)(CHAR*,CHAR*,INT);
PESDEMUX_ProcessFile pProcessFile;
CHAR chInFileName[255];
strcpy(chInFileName, m_csPCFileName); //Conversion CString to CHAR*
CHAR chOutFileName[255];
m_csPCFileName = m_csPCFileName + ".mpg";
strcpy(chOutFileName, m_csPCFileName); //Conversion CString to CHAR*
INT Type = 1;
HINSTANCE hDll = 0;
hDll = LoadLibrary("XtlPes.dll");
if (hDll != NULL)
{
pProcessFile = (PESDEMUX_ProcessFile)GetProcAddress(hDll,"PESDEMUX_ProcessFile");
if (!pProcessFile)
{
FreeLibrary(hDll);
return FALSE;
}
else
{
BOOL BResult = TRUE;
BResult = pProcessFile(chInFileName,chOutFileName,Type);
if (BResult == FALSE)
{
TRACE("Conversion Process OK\n");
}
else
TRACE("Conversion Process non OK\n");
}
}
|
|
|
|
|
How do I set a dialogs icon from a created icon recource. It’s not the main dialog I wish to set.
.....and justice for all
APe
|
|
|
|
|
I am assuming you are using MFC. Use SetIcon function to set icon of the dialog box. For e.g.:
BOOL CMyDialog::OnInitDialog()
{
HICON hIcon = AfxGetApp()->LoadIcon(IDI_MYICON);
SetIcon(hIcon, TRUE);
}
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
Thanks
.....and justice for all
APe
|
|
|
|