Can anybody help me in copying AAComBSTR to BYTE. Is there any API available which does this copy. Your help is appreciated.
V K 2
Posts
-
copying AAComBSTR to BYTE -
ProcessShellCommand () crashes after migrating an application which was originally written in VC 6.0 to VS2010It crashes at EnterCriticalSection in below function of C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\afxcrit.cpp void AFXAPI AfxLockGlobals(int nLockType) { ---- ---- // lock specific resource EnterCriticalSection(&_afxResourceLock[nLockType]); ----- }
-
ProcessShellCommand () crashes after migrating an application which was originally written in VC 6.0 to VS2010CCommandLineInfo cmdInfo; ParseCommandLine( cmdInfo ); // Dispatch commands specified on the command line if( !ProcessShellCommand( cmdInfo ) ) return FALSE;
-
ProcessShellCommand () crashes after migrating an application which was originally written in VC 6.0 to VS2010We have migrated our application which was written in VC 6.0 to VS2010. The application crashes on launching it. The crash occurs at ProcessShellCommand( ). On debugging got this error "Unhandled exception at 0x7575d36f in MyApp.exe: Microsoft c++ exception CInvalidArgException at memory location 0x0012fb98" What could be the problem and possible fix for this. Thanks in Advance.
-
Issue with CreateControl after migration a workspace which was in VC6 to VS2010We have migrated our workspace from VC6.0 to VS2010. There is a CreateControl api which is returning 0 after converting to VS2010. Before conversion this was working fine. What could be the reason for failure.
-
IsUserAdmin returns false when UAC is enabaled in VS2010The following piece of code was working fine in VC++6.0 . When UAC was enabled/disabled , for an administrative user the IsUserAdmin was returning true. We are migrating VC++6.0 to VS2010. After this when UAC is enabled IsUserAdmin is returning false and when UAC is disabled IsUserAdmin is returning true. Why is this failing in VS2010 when UAC is enabled and what could be fix for this. BOOL IsUserAdmin(VOID) /*++ Routine Description: This routine returns TRUE if the caller's process is a member of the Administrators local group. Caller is NOT expected to be impersonating anyone and is expected to be able to open its own process and process token. Arguments: None. Return Value: TRUE - Caller has Administrators local group. FALSE - Caller does not have Administrators local group. -- */ { BOOL b; SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; PSID AdministratorsGroup; b = AllocateAndInitializeSid( &NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup); if(b) { if (!CheckTokenMembership( NULL, AdministratorsGroup, &b)) { b = FALSE; } FreeSid(AdministratorsGroup); } return(b); } Thanks in advance
-
LoadLibraryW(dllpath) failsThe exact path is LoadLibraryW("C:\\Program Files\\MyApp\\");
-
LoadLibraryW(dllpath) failsThe dll is physically existing in the desired path. But still LoadLibraryW( ) fails.
-
LoadLibraryW(dllpath) failsWe are calling LoadLibary in C#. For this we have included the below code in the C# file. [DllImport("Kernel32.dll")] internal static extern IntPtr LoadLibraryW([MarshalAs(UnmanagedType.LPWStr)] String lpMdoule); We have multiple LoadLibaryW( ) calls. All of them are passing , except one. We verified the GetLastError( ). It returns 126. But the dll is physically existing in the correct path. What could be the reason for dll failure.
-
LoadLibraryW("C:\abc.dll") failsThe dll's which this dll is dependent are available in the appropriate locations. Also tried verifying them in dependencyWalker. There are no dependency erros seen in it. But still the LoadLibaryW call is failing.
-
LoadLibraryW("C:\abc.dll") failsWe are calling LoadLibary in C#. For this we have included the below code in the C# file. [DllImport("Kernel32.dll")] internal static extern IntPtr LoadLibraryW([MarshalAs(UnmanagedType.LPWStr)] String lpMdoule); We have multiple LoadLibaryW( ) calls. All of them are passing , except one. We verified the GetLastError( ). It returns 126. But the dll is physically existing in the correct path. What could be the reason for dll failure.
-
Use single bool and bit flags for other bools.Hi, I have 10 bool variables in a class. Instead of creating 10 bools, how to create a single bool and bit flags for remaining 9 bool variables inorder to efficiently use memory. Can I have a code snippet in C# for this.. Thanks in Advance.
-
Socket connection is getting closed when terminal services is enabled in Win2008R2 OSHi, My machine has Win2008R2 OS and terminal services enabled. I am trying to open a socket. But immediately after connecting to the socket the connection is getting closed. Is ther anything related to terminal services that is causing this issue When I disabled the terminal services.. everything is working fine. Thanks
-
Directory creation under a restricted folder.My system has a directory C:\AAAA. Where 'AAAA' has security permissions set. ie., only read operations can be performed and no write operations. My application tries to create a directory under 'AAAA'. i.e, C:\AAAA\BBBB. I am trying to handle an exception to avoid a crash - try { Directory.CreateDirectory("C:\\AAAA\\BBBB"); } catch(Exception ex) { } But I am observing that the catch handler is never invoked. My application is trying to create the directory, It is unable to create and it goes to the next statement after the catch block. What would be the code to check whether a directory can be created under AAAA or not.
-
how to get Window name from window handle in win32.how to get Window name from window handle in win32.
-
Get an exception while opening a fileIt gives me the below value for ex.GetErrorMessage ex ={Cause=0 OS Error = m_IOsError}
-
Get an exception while opening a fileI have tried putting only one of the CFile::shareExclusive|CFile::shareDenyNone , still it crashes.
-
Get an exception while opening a fileHi , I am using the below code for retrieving the length of a file. I have list of file names in a CStringArray object. bool Search(CString szBinName,CString szBinSize,CStringArray& arr) { int nSize = arr.GetSize(); CString str,temp; bool bRet; bRet = false; for(int i=0;i
-
Code snippet for searching a file in directory (directory can have subdirectories in it)Hi, I need to search for a file in a specific directory. This directory would also have subdirectories in it. Can I have a API / code snippet for this. Thanks in advance.
-
Code snippet for reading from a .xlsx file in VC++Hi, I have a excel file with two columns. Namely Binary Name, Binary Size. I need to read each binary name,size from the excel file and compare that with the Binary name and size in the corresponding installation folder. Can I have a code snippet for reading the Binary Name, Binary Size from the .xlsx file Thanks in advance.