|
you must change the REG_OPTION_VOLATILE to KEY_ALL_ACCESS.
Hope this helps...
|
|
|
|
|
The KEY_ALL_ACCESS is the next argument
|
|
|
|
|
I must sleep more! sorry...
|
|
|
|
|
You have to create RegKey using options 'REG_OPTION_NON_VOLATILE' instead of 'REG_OPTION_VOLATILE'.
For more details, Check RegCreateKeyEx API in MSDN.
If you are developing MFC/ATL based app...you can use CRegKey for easy registry access.
Hope this helps.
Ramu
|
|
|
|
|
This solves the problem
thanks
|
|
|
|
|
this way is how I do it:
HKEY hKey;
int iLength = 0;
CString csPathSubClau = "";
iLength = csNouValor.GetLength();
csPathSubClau.Format("%s\\%s",m_csPathBase,csSubClau);
RegOpenKeyEx(HKEY_LOCAL_MACHINE,csPathSubClau,0,KEY_ALL_ACCESS,&hKey);
RegSetValueEx(hKey,csValor,0,REG_SZ,(BYTE *)csNouValor.GetBuffer(iLength),iLength);
RegFlushKey(hKey);
RegCloseKey(hKey);
|
|
|
|
|
Never use KEY_ALL_ACCESS - only request the access you need. Only admininstrators can open keys with KEY_ALL_ACCESS.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
If im trying to print a BMP larger than the page size could sme one tell me the exact scaling method so that
1-the BMP is scaled to fit into a single page
2-The BMP is scaled without any distortion.
Im using stretchBlt without much sucess in proper scaling presently
please advise
fordge
|
|
|
|
|
You need to consider when blting the size of the image and the DPI resolution of the printer in the X/Y directions.
You can do this by using GetDeviceCaps() with LOGICALPIXELSX/Y to get the DPI resolutions and HORZRES and VERTRES to get the number of pixels available. From there you need to work out the DPI ratios and from that work out which bound (x or y) of your bitmap is largest and use that bound to scale the other correctly for your StretchBlt operation.
I don't have any code available to demostrate this, but it shouldn't be too hard to construct.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
is anybody knows a Good ActiveX for charting ?
another thing is i have no money to buy it
thnx
-=Ehsan-de-Burge=-
|
|
|
|
|
Hi All,
I am developing a service for win 2000 on VC++, that service accesses the databse to retreive some information like user id etc. I am using CDatabase and CRecordset classes for accessing the database. but the problem is that when i call a method (that access the database) from the main service loop, it reports a Run time Error, and after that Service Application terminates. the line is
CDatabase db;
db.OpenEx("DSN=MailMove;SERVER=LOCALHOST;UID=;PWD=;DATABASE=;");
This is working fine in regular MFC Application (eg dialog based) but when i call the same method through the service's main loop, it reports the error.
Please point out any one knows about what is going wrong. Its an urgent.
Thanks in advance.
bye
Asim
|
|
|
|
|
A guess:
Run() on Win32 Service is generally executed on different thread.
And CDatabase (may/may not) need MFC initialisation before its being invoked.
And AfxWinInit is used to initialse MFC for non-MFC applications.
Add the following line in the very begining of the Run() Method
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, NULL, 0))
{
cerr << "MFC failed to initialize!" << endl;
return 1;
}
and maybe an instance of CWinApp. Check AfxWinInit API in MSDN for more details.
Hope this helps!
Ram
|
|
|
|
|
Hi,
Thanks for replying,
I have inserted the code that u have asked, but this code is causing a
"Debug Assertion Failed!"
error. Please tell me how to tackle the problem. I have an Application that can run in two modes, i.e. GUI MFC Application and NT Service.
Please reply as soon as Possible.
Thanks alot
Asim
|
|
|
|
|
Hi world...
I've created a CPropertySheet dialog, but I want to put this dialog inside another that I've created myself (with others components: editbox, etc.)
How to do that?
I dont want use CTabCtrl... But the result is almost the same one.
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
1. Insert a CStatic in the dialog.
2. Create the CPropertysheet modeless and set it's parent window as he CStatic inserted.
Hope this helps.
|
|
|
|
|
this->m_pPSEstacio = new CPSEstacio("", this, 0);
this->m_pPSEstacio->Create(this, WS_CHILD | WS_TABSTOP);
this->m_pPSEstacio->ModifyStyleEx(0,WS_EX_CONTROLPARENT);
this->m_pPSEstacio->ModifyStyle(0,WS_VISIBLE);
|
|
|
|
|
Hello,
I have a DLL that I've written and I have it's lib file.
I would like to import one function of that DLL using that lib file.
I'm on the DEBUG link version of a Service, and in the Project->Settings->Link->Object library modules I've included the path to that lib file.
I've placed the DLL inside the same directory of the service.
When I edit the source code of the service in the VC++6 editor and I write down the name of the function that I want to import, a tooltip appears with the guidelines of how to continue writting that function (parameters and so on...)
Ok.
after having said this, when I try to link the code I receive this error message:
C:\blablabla.cpp(357) : error C2065: 'bActivarHook' : undeclared identifier
Generating Code...
Error executing cl.exe.
bActivarHook is the function that I want to import.
any idea?
Thank you in advance.
bla.exe - 1 error(s), 0 warning(s)
|
|
|
|
|
I dont know if I have understood your situation but I suppose that you have added the header file of your DLL (defined the exported functions) into the project that use your DLL?
I suppose... because you have writed:
When I edit the source code of the service in the VC++6 editor and I write down the name of the function that I want to import, a tooltip appears with the guidelines of how to continue writting that function (parameters and so on...)
Hello World!!!
from Raphaël
|
|
|
|
|
No,
let me explain better, my english is not my best...
1. I have a DLL that installs a system wide keyboard hook that exports a function lets call it FxA.
2. In the project of the service that will launch that function (FxA) I've added the LIB file of the DLL going to the menu item: (Project -> Settings -> Link) and writting there the path to that lib file.
3. Once this has been done, I try to use that function from my service calling it directly (i.e: FxA(true); )
but when I link the service App. the linker tells me that:
error C2065: 'FxA' : undeclared identifier
Generating Code...
Error executing cl.exe.
SCTATL.exe - 1 error(s), 0 warning(s)
And I don't know why.
I'm sure that I'm missing something important, but I cannot remember what it is.
Do you know what I'm missing in order to be able to import that function?
NOTE:
when I've written:
When I edit the source code of the service in the VC++6 editor and I write down the name of the function that I want to import, a tooltip appears with the guidelines of how to continue writting that function (parameters and so on...)
I meant that when in the source code I have written the name of the function ("FxA(") and a "(" then a tooltip appears with the right type of parameter that I must enter... and this makes me to think that the VisualC++ knows the existence of that FxA function.
NOTE2:
Have I helped you with the Property sheet affair?
|
|
|
|
|
did you have omitted this?
#ifndef DLLEXPORT
#define DLLEXPORT _declspec(dllexport)
#endif
DLLEXPORT void FxA(bool bValue);
in your header file... (I repeat: you must to add this header file to your service project)
Joan Murt wrote:
Have I helped you with the Property sheet affair?
I'm trying... thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
er...
You was right
I had not placed that file there...
that was a big mistake!
Thank you very much, you've helped me.
|
|
|
|
|
dear all,
i am using the following code to get root directory and then find out the file system.
but it gives an error Specified Path iS Invalid!
what wrong have i done!
is there any other (better) way to do it!
plz. help!!!
DWORD dwError;
CString RootPathName;
CString RootDir;
UINT i = GetWindowsDirectory(RootPathName.GetBuffer(MAX_PATH),MAX_PATH);
RootDir= RootPathName.Mid(0,2);
AfxMessageBox(RootDir);
BOOL bFSResult = GetVolumeInformation (RootDir.GetBufferRootDir.GetLength)),
NULL,
0,
NULL,
NULL,
NULL,
FileSystem.GetBuffer(MAX_PATH),
MAX_PATH);
dwError = GetLastError();
AfxMessageBox(FileSystem);
|
|
|
|
|
UINT i = GetWindowsDirectory(RootPathName.GetBuffer(MAX_PATH),MAX_PATH);
RootPathName.ReleaseBuffer();
RootDir= RootPathName.Mid(0,3);
rechi
|
|
|
|
|
This is my code for it : (I don't prefere using CString with APIs and this is just because I feel it's easier to use char)
char WinDir[MAX_PATH];
char Vol[4];
char FileSystem[10];
UINT i = GetWindowsDirectory(WinDir,MAX_PATH);
AfxMessageBox(WinDir);
strncpy(Vol,WinDir,3);
Vol[3]='\0';
AfxMessageBox(Vol);
BOOL bFSResult = GetVolumeInformation (Vol,
NULL,
0,
0,
0,
0,
FileSystem,
10);
AfxMessageBox(FileSystem);
|
|
|
|
|
Hi !
I started yesterday to write my first MDI app (with MFC, let's get at it slowly ). This is a kind of text viewer, maybe editor (Yes, another one but i think it's a good example to start). You may say there is not much to do, but ...
Anyway, my first problem is that i'd like the child windows to be maximized when a document is opened. Currently the child window is about half the size of the screen, in the middle. Since the main frame is maximized at startup, i'd like the child win to be maximized also.
So i intercetpted the CREATESTRUCT from the PreCreateWindow in CMDIChild class, and did :
cs.style|=WS_MAXIMIZE;
But this would not change anything. I tried this in several other places, and also with ShowWindow(WS_MAXIMZED) , but no way, my win is still not maximized. What's wrong ?
~RaGE();
|
|
|
|