Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by cra

  1. cra

    Possible VC++ bug concerning static functions vs. non-static variables

    Actually, I extracted both examples from a bigger IDE-based project and separately compiled them using the cl command line compiler, so there are no hidden temp files, pch files or whatever. The first one still compiles. And I just did a) a "clean"/"build" and b) a "rebuild all" on my original...
  2. cra

    Possible VC++ bug concerning static functions vs. non-static variables

    Hi all, what do you think of the following? Example 1 compiles: class MyClass { public: static void func(); private: bool itsFlag; }; void MyClass::func() { int i = itsFlag ? 0 : 1; } Example 2 does not compile: class MyClass { public: static void func(); private: bool itsFlag; }...
  3. cra

    malloc failed

    I am sure you already read this, however I am including it here: 1526/1527 ERROR: Memory allocation failure error_info Description An attempt dynamically to allocate memory from the operating system failed while trying to tpalloc() a buffer. Additional information is printed with the...
  4. cra

    How 2 allow untrusted servercertificates with javax.net.ssl.SSLSocket?

    Hi, I want to use SSL simply to crypt data. It is *not* important to me to validate the identity of the server. So how do I convince javax.net.ssl.SSLSocketFactory and SSLSocket to accept *any* server certificate when I open a connection in my Java client? I created the server certificate...
  5. cra

    There is a way to BackUp the Tuxedo Queue

    Do you mean the internal shared-memory service request and response queues or the /Q system? If you are passing messages via the /Q system (i.e. using tpenqueue() and tpdequeue() or TMQFORWARD servers), backup is automatically because all queue messages are usually stored in a file that is...
  6. cra

    Run as another user

    I forgot: To cancel the impersonation, use RevertToSelf()
  7. cra

    Run as another user

    Two steps are necessary: 1) Logon and 2) "Impersonation". Example: HANDLE hToken; LogonUser(localUser, NULL, localPassword, LOGON32_LOGON_BATCH, LOGON32_PROVIDER_DEFAULT, &hToken); ImpersonateLoggedOnUser(hToken); CloseHandle(hToken); Of course, you have to add error handling etc.
  8. cra

    declaring a constant

    hi dexy99, a floating point constant like "3.1415" is assumed to be of double precision in C++ by default. Your compiler just warns you that you initialize a single-precision constant using a double-precision value - if you use many digits after the point they may actually be lost in...
  9. cra

    Getting the working directory.

    I assume you do not want to know the working directory, but the directory where the .exe file is located. The GetModuleFileName() Win32 API function tells you that: TCHAR appPath[MAX_PATH+1]; if( GetModuleFileName(NULL, appPath, MAX_PATH) == 0 ) { //failure } else { CString...
  10. cra

    Service request problem

    Error code 9 is the TPEPROTO error (protocol error). This usually means that a service was called in a context where this is not allowed. Without more information it is difficult to diagnose it ;-)
  11. cra

    Hi, does anyone know how to over

    yes of course... and it would be bad style to do it before when the application *is* in the foreground (at least without asking the user to allow a user profile modification).
  12. cra

    Hi, does anyone know how to over

    Ha! Found it in the MS Knowledge base: Call SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, (LPVOID)0, SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE) and *all* the applications on your system behave like under Windows NT or 95 and can put themselves into the foreground - this is a global...
  13. cra

    Hi, does anyone know how to over

    Hi, does anyone know how to overcome the following restriction in the Win32 API under Win2K/XP? "Windows NT 5.0 and later: An application cannot force a window to the foreground while the user is working with another window. Instead, SetForegroundWindow will activate the window (see...
  14. cra

    How to put window to front in WinXP

    strange - it should NOT work in Win2k, too, quote from the Win32 doc: Windows NT 5.0 and later: An application cannot force a window to the foreground while the user is working with another window. Instead, SetForegroundWindow will activate the window (see SetActiveWindow) and call...
  15. cra

    Physical memory only

    No, you can force Win32 to lock memory into physical memory using the VirtualLock() function. Please look at the documentation of VirtualLock() for details because there are some prerequisites (all memory pages must be committed, there is a maxiumum of locked pages, etc.).

Part and Inventory Search

Back
Top