|
MSDN : MultiSoc : Illustrates Using Sockets in Multiple Threads
MSDN(SDK) : Power Outlets in Action: Windows Sockets
|
|
|
|
|
MSDN: CHATSRVR Sample: Demonstrates a Windows Sockets Server
|
|
|
|
|
i did not find the mutliSoc article can you give me the link please
if you think that you can't , that means that you can : if you understand this there youn can
|
|
|
|
|
http://download.microsoft.com/download/vc60pro/Sample4/1/WIN98/EN-US/MultiSoc.exe
|
|
|
|
|
The problem is that all data that i save in the registry is gone after windows (2000) is restarted. All data appears to be ok after the application closes. But after the restart the key is completely gone.
The code used in the app:
Opening the key:
HKEY hKeyRoot = HKEY_CURRENT_USER;
LPCTSTR pszPath = "Software\\Companyname\\My App Name\\Settings"
HKEY hKey;
DWORD dw;
RegCreateKeyEx(hKeyRoot, pszPath, 0L, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dw);
Writing:
int iValue = 8;
LPCTSTR pszKey = "MyInteger";
hKey as returned by RegCreateKeyEx
RegSetValueEx(hKey, pszKey, 0L, REG_DWORD, (CONST BYTE*)&iValue, sizeof(int));
Does anyone know how to prevent this and why it happens?
Thanks
I'm smart enough to know that i'm stupid and i'm stupid enough to think that i'm smart
|
|
|
|
|
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
|
|
|
|