Click here to Skip to main content
15,891,316 members
Home / Discussions / C#
   

C#

 
AnswerRe: Has anyone every seen this before? The logic doesnt make sense Pin
Dominic Burford5-Jan-15 18:48
professionalDominic Burford5-Jan-15 18:48 
GeneralRe: Has anyone every seen this before? The logic doesnt make sense Pin
Member 113371086-Jan-15 6:25
Member 113371086-Jan-15 6:25 
GeneralRe: Has anyone every seen this before? The logic doesnt make sense Pin
BillWoodruff6-Jan-15 6:33
professionalBillWoodruff6-Jan-15 6:33 
AnswerRe: Has anyone every seen this before? The logic doesnt make sense Pin
V.5-Jan-15 20:26
professionalV.5-Jan-15 20:26 
GeneralRe: Has anyone every seen this before? The logic doesnt make sense Pin
Member 113371086-Jan-15 6:35
Member 113371086-Jan-15 6:35 
GeneralRe: Has anyone every seen this before? The logic doesnt make sense Pin
V.6-Jan-15 6:40
professionalV.6-Jan-15 6:40 
Question32-bit process calling Marshal.GetExceptionPointers. Pin
LLAKW5-Jan-15 9:03
LLAKW5-Jan-15 9:03 
Question[EDIT] System.AccessViolationException in Windows 8.1 Pin
Django_Untaken5-Jan-15 6:13
Django_Untaken5-Jan-15 6:13 
Hello. I was given a small project which compiles and runs successfully in Windows 7. I also tested the project on Windows 7. But as soon as I tried to run the project on Windows 8.1, it started giving me said exception.

This definitely is not a programming error. This has something to do with system setting which I can not find out. Here is the code in which exception occurs (calling method is fine) . . .
public static void* Alloc(int size) // size = 1920000
{
    try
    {
       static int ph = GetProcessHeap(); // class variable

        void* result = HeapAlloc(ph, HEAP_ZERO_MEMORY, size);
        if (result == null)
        {
            throw new OutOfMemoryException();
        }
        return result;
    }
    catch(Exception ex)
    { }

    return null;
}

// Heap API functions
[DllImport("kernel32")]
static extern int GetProcessHeap();

[DllImport("kernel32")]
static extern void* HeapAlloc(int hHeap, int flags, int size);


What could be wrong ?? Thanks for any pointer.

modified 6-Jan-15 4:02am.

GeneralRe: System.AccessViolationException in Windows 8.1 Pin
PIEBALDconsult5-Jan-15 6:23
mvePIEBALDconsult5-Jan-15 6:23 
AnswerRe: System.AccessViolationException in Windows 8.1 Pin
Richard MacCutchan5-Jan-15 7:02
mveRichard MacCutchan5-Jan-15 7:02 
AnswerRe: System.AccessViolationException in Windows 8.1 Pin
Dave Kreskowiak5-Jan-15 7:06
mveDave Kreskowiak5-Jan-15 7:06 
AnswerRe: System.AccessViolationException in Windows 8.1 Pin
jschell5-Jan-15 9:25
jschell5-Jan-15 9:25 
AnswerRe: [EDIT] System.AccessViolationException in Windows 8.1 Pin
Richard MacCutchan5-Jan-15 22:26
mveRichard MacCutchan5-Jan-15 22:26 
GeneralRe: [EDIT] System.AccessViolationException in Windows 8.1 Pin
Django_Untaken5-Jan-15 23:08
Django_Untaken5-Jan-15 23:08 
GeneralRe: [EDIT] System.AccessViolationException in Windows 8.1 Pin
Richard MacCutchan5-Jan-15 23:38
mveRichard MacCutchan5-Jan-15 23:38 
GeneralRe: [EDIT] System.AccessViolationException in Windows 8.1 Pin
Dave Kreskowiak6-Jan-15 13:59
mveDave Kreskowiak6-Jan-15 13:59 
AnswerRe: [EDIT] System.AccessViolationException in Windows 8.1 Pin
Richard Deeming6-Jan-15 2:12
mveRichard Deeming6-Jan-15 2:12 
QuestionMetro UI for windows Form Pin
Hari-CodeBlogger4-Jan-15 23:10
Hari-CodeBlogger4-Jan-15 23:10 
AnswerRe: Metro UI for windows Form Pin
BillWoodruff5-Jan-15 2:27
professionalBillWoodruff5-Jan-15 2:27 
AnswerRe: Metro UI for windows Form Pin
Swinkaran5-Jan-15 12:41
professionalSwinkaran5-Jan-15 12:41 
GeneralRe: Metro UI for windows Form Pin
Ravi Bhavnani5-Jan-15 17:55
professionalRavi Bhavnani5-Jan-15 17:55 
GeneralRe: Metro UI for windows Form Pin
Hari-CodeBlogger6-Jan-15 23:58
Hari-CodeBlogger6-Jan-15 23:58 
GeneralRe: Metro UI for windows Form Pin
Dave Kreskowiak7-Jan-15 2:23
mveDave Kreskowiak7-Jan-15 2:23 
GeneralRe: Metro UI for windows Form Pin
Hari-CodeBlogger7-Jan-15 3:51
Hari-CodeBlogger7-Jan-15 3:51 
GeneralRe: Metro UI for windows Form Pin
Dave Kreskowiak7-Jan-15 5:19
mveDave Kreskowiak7-Jan-15 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.