Click here to Skip to main content
15,905,971 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCopyMemory VB.NET Pin
chiragdanech7-Apr-06 9:26
chiragdanech7-Apr-06 9:26 
AnswerRe: CopyMemory VB.NET Pin
Joshua Quick7-Apr-06 12:07
Joshua Quick7-Apr-06 12:07 
GeneralRe: CopyMemory VB.NET Pin
chiragdanech8-Apr-06 7:14
chiragdanech8-Apr-06 7:14 
AnswerRe: CopyMemory VB.NET Pin
Joshua Quick8-Apr-06 9:18
Joshua Quick8-Apr-06 9:18 
GeneralRe: CopyMemory VB.NET Pin
chiragdanech8-Apr-06 9:22
chiragdanech8-Apr-06 9:22 
QuestionRe: CopyMemory VB.NET Pin
Joshua Quick8-Apr-06 9:41
Joshua Quick8-Apr-06 9:41 
AnswerRe: CopyMemory VB.NET Pin
chiragdanech8-Apr-06 9:47
chiragdanech8-Apr-06 9:47 
GeneralRe: CopyMemory VB.NET Pin
Joshua Quick9-Apr-06 10:49
Joshua Quick9-Apr-06 10:49 
After looking at your code, the only reason MoveMemory() is called is for performance reasons. Maybe in VB6 this was faster, but in VB.NET I doubt it. The reason is because a call to MoveMemory() is a call to unmanaged code, requiring a P/Invoke, which is a performance hit in .NET. I suggest that you make it easy on yourself, remove all of the MoveMemory() calls, and just iterate through the 2d array and directly copy the color values into your 1d array. You can look into boosting performance after you get it working.

Also, there appears to be a lot of legacy VB6 calls in your VB.NET code. You may just want to rewrite the whole thing.
You should replace your "On Error Goto" with Try/Catch.
You should replace "DoEvents" with "Application.DoEvents()".
Do a "Return lColors" instead of "LongPixels = lColors", and perhaps return an empty array on error.
GeneralRe: CopyMemory VB.NET Pin
chiragdanech9-Apr-06 10:55
chiragdanech9-Apr-06 10:55 
AnswerRe: CopyMemory VB.NET Pin
Joshua Quick9-Apr-06 12:12
Joshua Quick9-Apr-06 12:12 
QuestionPDF to printdocument Pin
aWaLsH5237-Apr-06 5:51
aWaLsH5237-Apr-06 5:51 
QuestionWindows Service Not in the list Pin
Brent Lamborn7-Apr-06 5:35
Brent Lamborn7-Apr-06 5:35 
AnswerRe: Windows Service Not in the list Pin
Purple Monk7-Apr-06 5:50
Purple Monk7-Apr-06 5:50 
GeneralRe: Windows Service Not in the list Pin
Brent Lamborn7-Apr-06 9:22
Brent Lamborn7-Apr-06 9:22 
QuestionProblem with form loading Pin
wliong7-Apr-06 5:34
wliong7-Apr-06 5:34 
AnswerRe: Problem with form loading Pin
Purple Monk7-Apr-06 5:55
Purple Monk7-Apr-06 5:55 
GeneralRe: Problem with form loading Pin
wliong7-Apr-06 6:41
wliong7-Apr-06 6:41 
Questionconverting a report to PDF and saving it(in VB 6.0) Pin
dex58ter7-Apr-06 4:10
dex58ter7-Apr-06 4:10 
AnswerRe: converting a report to PDF and saving it(in VB 6.0) Pin
Vikrant Badhai7-Apr-06 23:38
Vikrant Badhai7-Apr-06 23:38 
QuestionPrintPreviewDialog Class - Default Title Pin
paas7-Apr-06 3:45
paas7-Apr-06 3:45 
AnswerRe: PrintPreviewDialog Class - Default Title Pin
paas7-Apr-06 9:43
paas7-Apr-06 9:43 
Questioni have seriously problem with vb.net (hook) Pin
bkarasa7-Apr-06 2:09
bkarasa7-Apr-06 2:09 
AnswerRe: i have seriously problem with vb.net (hook) Pin
Purple Monk7-Apr-06 2:20
Purple Monk7-Apr-06 2:20 
GeneralRe: i have seriously problem with vb.net (hook) Pin
bkarasa7-Apr-06 3:07
bkarasa7-Apr-06 3:07 
GeneralRe: i have seriously problem with vb.net (hook) Pin
Purple Monk7-Apr-06 5:38
Purple Monk7-Apr-06 5:38 

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.