windows-vista

Why can't I get GetPrivateProfileString to work via pinvoke?

冷暖自知 提交于 2019-12-05 15:23:21
Running a c# console app I wrote on 64 bit Vista. Here's the code: class Class1 { static void Main(string[] args) { Debug.Assert(File.Exists(@"c:\test.ini")); StringBuilder sb = new StringBuilder(500); uint res = GetPrivateProfileString("AppName", "KeyName", "", sb, sb.Capacity, @"c:\test.ini"); Console.WriteLine(sb.ToString()); } [DllImport("kernel32.dll")] static extern uint GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName); } I'm sure I'll get a big "DUH!" for an answer, but I'm not seeing why this

How to run application with Admin privileges using Manifest file in Visual Studio 2005?

社会主义新天地 提交于 2019-12-05 11:46:01
问题 I need to create an application which needs to create files/folders in "C:\Program Files","Users[username]" and Sys32. Also the application needs to make some registry entry. This application needs to work on Vista and higher. Also, on Windows Server 2003 and higher. The above Operating Systems have the concept of User Account Control (UAC), where to access Program Files and writing in registry requires admin privileges. I looked into many forums and found that using Microsoft SDK we can

Programatically registering .dll's on Windows Vista (using DllRegisterServer)

杀马特。学长 韩版系。学妹 提交于 2019-12-05 09:38:02
Instead of calling regsvr32.exe , one can register a .DLL using the following steps: HINSTANCE hLib = ::LoadLibraryEx(dllPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); HRESULT (STDAPICALLTYPE* lpDllEntryPoint)(void); (FARPROC&)lpDllEntryPoint = ::GetProcAddress(hLib, "DllRegisterServer"); const HRESULT hRes = (*lpDllEntryPoint)(); This works fine on Windows XP. Regrettably, it fails on Vista, but only with some specific DLLs. hRes becomes E_ACCESSDENIED . I guess this is a security issue. Does anyone know how to register a .DLL from code on Windows Vista? Note: I was logged in as administrator

Localhost not working on XAMPP - both service apache & mysql are fine

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 08:25:09
问题 My xampp installation 1.7.1 does not seem to work. http://localhost returns not found error. Xampp Control panel shows both mysql & apache service running fine. I'am on windows vista. Frustrated since past 2 weeks to find a solution to this. Any pointers and support will be appreciated! Thanks a ton folks. 回答1: I struggled for days figuring out why I was getting a blank screen while using xampp. The cultprit was skype. Always turn of skype when you want to use localhost. 回答2: In your "xampp"

memory allocation in C

ε祈祈猫儿з 提交于 2019-12-05 07:49:18
I have a question regarding memory allocation order. In the following code I allocate in a loop 4 strings. But when I print the addresses they don't seem to be allocated one after the other... Am I doing something wrong or is it some sort of defense mechanism implemented by the OS to prevent possible buffer overflows? (I use Windows Vista). Thank you. char **stringArr; int size=4, i; stringArr=(char**)malloc(size*sizeof(char*)); for (i=0; i<size; i++) stringArr[i]=(char*)malloc(10*sizeof(char)); strcpy(stringArr[0], "abcdefgh"); strcpy(stringArr[1], "good-luck"); strcpy(stringArr[2], "mully");

Turning on Presentation Mode in Windows?

*爱你&永不变心* 提交于 2019-12-05 06:55:47
Windows Vista has "Presentation Mode", which you can turn on with the Mobility Center. How can I turn it on programmatically? The only way I found is to call presentationsettings.exe with /start or /stop directly. I also found this link that describes how to activate presentation mode on desktop PCs: http://www.dubuque.k12.ia.us/it/mobilitycenter/ Hope that helps. This seems to fill your need: link text This is quite old, but I found this wasn't working from a third party program, because cmd wasn't inheriting the environment, therefore these weren't working like they would from the Run Box:

Why go 64 bit OS? [closed]

荒凉一梦 提交于 2019-12-05 06:16:48
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . On these questions: Which Vista edition is best for a developer machine? Vista or XP for Dev Machine People are recommending 64 bit, can you explain why? Is it just so you can have more then 3GB of addressable RAM that 32 bit gives you? And how does Visual Studio benefit from all this extra RAM? I went from 64 bit XP back to 32 bit due to 90% of the software I was using only being 32 bit anyway and I had issues

Catch “The program stopped working” on Vista

青春壹個敷衍的年華 提交于 2019-12-05 06:01:45
On Vista, I got a problem with the application crash handler. Basically, if something unexpected occurs which cannot be captured by SEH, I get this pop-up window with "The application stopped working", blablabla, "Close program/Debug program" -- that is, after I disable the error reporting using the system control panel. With error reporting enabled, you would get a task dialog with search for solution online, close, debug. This is not so funny if it happens in automated tools, and I wonder whether there is a way to get rid of it totally , read, if my app crashes, it just crashes to the

Access to external window handles

流过昼夜 提交于 2019-12-05 05:50:43
问题 I am having a problem with the program I am currently working on. It is caused by the increased security in vista/Windows 7, specifically the UIPI which prevents a window with a lower integrity level 'talking' to a higher one. In my case, i am wanting to tell the window with a high Integrity level to move into our application, It works flawlessly on XP or windows 7 with the security off. I have tried setting the HWND of the higher IL window directly, rather than using the findwindow()

require_once ignored

送分小仙女□ 提交于 2019-12-05 05:42:45
问题 strange problem with php on windows... my application loads a 'core' file that loads a settings file, registers autoloads, does initialization etc. at the top of the core file I have include_once("config.php"); this works fine for anything in the current directory, if I include the core file from a separate directory though it just silently ignores the include of the config file... has anyone seen this before? /webroot/core.php <?php require_once "config.php"; //register autoloads //do some