Hello! I need to set the background color of all the controls on a dialog. I have problems with a tab control. Does someone know how to do it? -Alma-
alma
Posts
-
how to set CTabCtrl background color? -
CTabCtrl frame background colorHello! I need to change the background of a tab control. I can change the background of the tab windows, but I don't know how to change the background of the surrounding frame, keeping the lines that give the frame-like look. Does anyone know how to do that? Thanks in advance. -Alma-
-
com object, [out] params (pointers to values), C#Yes, that works! Thanks a lot!:) -Alma-
-
com object, [out] params (pointers to values), C#In the object browser my functions syntax looks this way: HRESULT _stdcall MyGetValue([out] int* value); IntelliSence info looks like this: void MyGetValue(out int value); whatever I put as a parameter it results in an error: The best overloaded method match for 'MYComObjectDllLib.IMyObject.MyFunction(out int)' has some invalid arguments -Alma-
-
com object, [out] params (pointers to values), C#I have a COM object written in C++. I want to use it from C#. For getting values out of the COM object I used functions like: HRESULT myfunction (/*[out]*/ BSTR* stringvalue, /*[out]*/ int* intvalue); How can I use these functions from c#? -Alma-
-
string to int, double?How can i convert a string into an int or double in C#? -Alma-
-
windows service written in C++, COM objects, call from C#I have done it in the following way: 1. registered the service: MyService.exe /service 2. added the associated type lib to the project: using MyServiceLib; (I used the Add reference wizard: Solution explorer tab, right click on the solution name, click on Add reference..., click on COM tab, in the appearing list box select the needed type library) 3. Created an object: IMyObject newObject = new MyServiceLib.MyObjectClass(); 4. Called the objects methods: newObject.Function(param1, param2); -Alma-
-
windows service written in C++, COM objects, call from C#How can I access the functions of a COM object located in a windows service? The windows service was written under Visual C++ 6.0. -Alma-
-
MFC/ATL thread syncronizationYeah, right! :) Thanks! -Alma-
-
MFC/ATL thread syncronizationWhat functions/classes should I use for thread syncronization inside a module that is used in both ATL and MFC projects? -Alma-
-
size of physical/virtual memory used by a process - WindowsNT/2000I found the following solution:
DWORD dwProcessID = GetCurrentProcessId(); HANDLE hProcessHandle = OpenProcess( PROCESS_QUERY_INFORMATION, FALSE, dwProcessID); PROCESS_MEMORY_COUNTERS p; GetProcessMemoryInfo(hProcessHandle , &p, sizeof(PROCESS_MEMORY_COUNTERS); logit("Using [PM - %d] [VM - %d]", p.WorkingSetSize, p.PagefileUsage);
It needs 'psapi.h' (and 'psapi.lib' if you want to load 'psapi.dll' statically). -Alma- -
size of physical/virtual memory used by a process - WindowsNT/2000Hello, How can I get the size of physical and virtual memory used by a process? Thanks, Alma
-
ATL based COM fire-event client ?How can I catch a fired COM event in an ATL based NT/win2k service? I have found only examples of clients written in VB or MFC. Alma.
-
MIDL compile problemThe 'cause' of the problem was that I switched the regional settings to another than US English. I use win2k sp3, vs6. :)
-
MIDL compile problemI dont know what could happen with my computer, I can not compile COM related projects. I removed visual studio, deleted all the files from 'program files\microsoft visual studio', installed visual c++. But it happens the same thing. Has somebody met this error or similar behavior before?
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl oaidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl objidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl unknwn.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl wtypes.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ocidl.idl ocidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oleidl.idl oleidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\servprov.idl servprov.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl urlmon.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\msxml.idl msxml.idl **C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ocidl.idl(847) : error MIDL2025 : syntax error : expecting a type specification near "CY" C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ocidl.idl(848) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation** Error executing midl.exe.
-
Converting TCHAR to BSTR with ATLYep, it workes this way. Thanks.
-
Converting TCHAR to BSTR with ATLIt worked, thanx
-
Converting TCHAR to BSTR with ATLI have to convert a TCHAR string to BSTR in an ATL based service without using MFC. I tried T2OLE, but I could not compile the project because some errors: '_lpa' : undeclared identifier, ... Could anyone help me out? Alma
-
WNetAddConnection2 fails with error code 1312The solution i found is to use the CreateService function with user and password parameters set. Ex: -------------------------------------------------------------------------------- CString user = _T(".\\User"); CString pswd = _T("pswd"); LPSTR u = user.GetBuffer(user.GetLength()+1); LPSTR p = pswd.GetBuffer(pswd.GetLength()+1); SC_HANDLE hService = ::CreateService( hSCM, m_szServiceName, m_szServiceName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, szFilePath, NULL, NULL, _T("RPCSS\0"), u, p); -------------------------------------------------------------------------------- To create the connection: -------------------------------------------------------------------------------- NETRESOURCE nr; char* a = new char[MAX_PATH]; memset(a, 0, MAX_PATH); char* b = new char[MAX_PATH]; memset(b, 0, MAX_PATH); strcpy(a, (char*)"\\\\alma\\geza"); strcpy(b,(char*)"x:"); char pswd[20] = "pswd"; char account[20] = "user"; nr.lpRemoteName = a; nr.lpLocalName = b; nr.lpProvider = NULL; nr.dwType = RESOURCETYPE_DISK; DWORD flags = CONNECT_UPDATE_PROFILE; DWORD res; res = WNetAddConnection2(&nr, (char*)pswd, (char*)account, flags); delete []a; delete []b; if (res == NO_ERROR) return TRUE; else return FALSE;
-
WNetAddConnection2 fails with error code 1312Hi! I have a win2000 service written in visual c++ 6.0 that has to access files from a shared folder from the local network neighborhood. The shared folders are password protected, so I have to create a connection to that folder. I tried to use WNetAddConnection2. But WNetAddConnection2 fails and returns the error code no. 1312. I looked it up in the winapi headers, error 1312 is called ERROR_NO_SUCH_LOGON_SESSION, the explanation given is : 'A specified logon session does not exist. It may already have been terminated.'. The list of files/locations is taken from a database, so is dynamically changing over time. Has anybody any idea how could I access files shared on other computers without logging in to the system? Thanks, Alma