Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: fund transfer from credit card Pin
darkelv17-Mar-08 2:25
darkelv17-Mar-08 2:25 
GeneralRe: fund transfer from credit card Pin
NAND_2017-Mar-08 3:49
NAND_2017-Mar-08 3:49 
QuestionHow to Schedule .exe file Pin
sjs4u16-Mar-08 21:06
sjs4u16-Mar-08 21:06 
AnswerRe: How to Schedule .exe file Pin
Giorgi Dalakishvili16-Mar-08 21:08
mentorGiorgi Dalakishvili16-Mar-08 21:08 
Generalwhat's the difference in object creation. Pin
Satish - Developer16-Mar-08 21:05
Satish - Developer16-Mar-08 21:05 
GeneralRe: what's the difference in object creation. Pin
Christian Graus16-Mar-08 21:12
protectorChristian Graus16-Mar-08 21:12 
GeneralWatermarking an image, with embossed Effect & Colors of text should be same as source image have Pin
adnanrafiq16-Mar-08 21:01
adnanrafiq16-Mar-08 21:01 
GeneralAttempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
D i x y16-Mar-08 20:34
D i x y16-Mar-08 20:34 
Hi i am using this code this some time gives me an error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

My code:

class PrivateFonts<br />
        {<br />
            [DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]<br />
            private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, int cbFont, int pdv, ref int pcFonts);<br />
            public System.Drawing.Text.PrivateFontCollection GetFont(string[] FontResource)<br />
            {<br />
                string NameSpc = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();<br />
                System.IO.Stream FntStrm;<br />
                System.Drawing.Text.PrivateFontCollection FntNc = new System.Drawing.Text.PrivateFontCollection();<br />
                int i;<br />
                for (i = 0; i <= FontResource.GetUpperBound(0); i++)<br />
                {<br />
                    FntStrm = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(NameSpc + "." + FontResource[i]);<br />
                    byte[] ByteStrm = new byte[(int)FntStrm.Length];<br />
                    FntStrm.Read(ByteStrm, 0, Convert.ToInt32((int)FntStrm.Length));<br />
                    IntPtr FntPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(typeof(byte)) * ByteStrm.Length);<br />
                    System.Runtime.InteropServices.Marshal.Copy(ByteStrm, 0, FntPtr, ByteStrm.Length);<br />
                    FntNc.AddMemoryFont(FntPtr, ByteStrm.Length);<br />
                    Int32 pcFonts;<br />
                    pcFonts = 1;<br />
                    AddFontMemResourceEx(FntPtr, ByteStrm.Length, 0, ref pcFonts);                    System.Runtime.InteropServices.Marshal.FreeHGlobal(FntPtr);<br />
                }<br />
                return FntNc;<br />
            }<br />
        }

GeneralRemoving Data from Excel Worksheet Pin
meeram39516-Mar-08 19:42
meeram39516-Mar-08 19:42 
GeneralAutogenerated Number Pin
sandipchandra17@gmail.com16-Mar-08 19:11
sandipchandra17@gmail.com16-Mar-08 19:11 
GeneralRe: Autogenerated Number Pin
Christian Graus16-Mar-08 19:47
protectorChristian Graus16-Mar-08 19:47 
GeneralRe: Autogenerated Number Pin
Ravenet16-Mar-08 20:19
Ravenet16-Mar-08 20:19 
QuestionRe: Autogenerated Number Pin
CPallini17-Mar-08 0:35
mveCPallini17-Mar-08 0:35 
QuestionEvents and delegates Pin
Pankaj Garg16-Mar-08 19:09
Pankaj Garg16-Mar-08 19:09 
GeneralRe: Events and delegates Pin
Christian Graus16-Mar-08 19:46
protectorChristian Graus16-Mar-08 19:46 
QuestionHow to pop-up connect to dialog box in C# Pin
jdkulkarni16-Mar-08 18:45
jdkulkarni16-Mar-08 18:45 
QuestionReading the path of a file in C# - URGENT!! Pin
Phivos Stylianides16-Mar-08 17:52
Phivos Stylianides16-Mar-08 17:52 
GeneralRe: Reading the path of a file in C# - URGENT!! Pin
PIEBALDconsult16-Mar-08 18:06
mvePIEBALDconsult16-Mar-08 18:06 
GeneralRe: Reading the path of a file in C# - URGENT!! Pin
Christian Graus16-Mar-08 18:44
protectorChristian Graus16-Mar-08 18:44 
GeneralRe: Reading the path of a file in C# - URGENT!! Pin
Ravenet16-Mar-08 20:21
Ravenet16-Mar-08 20:21 
GeneralRe: Reading the path of a file in C# - URGENT!! Pin
Phivos Stylianides16-Mar-08 20:34
Phivos Stylianides16-Mar-08 20:34 
GeneralRe: Reading the path of a file in C# - URGENT!! Pin
Ravenet16-Mar-08 20:46
Ravenet16-Mar-08 20:46 
GeneralRe: Reading the path of a file in C# - URGENT!! Pin
Phivos Stylianides16-Mar-08 21:06
Phivos Stylianides16-Mar-08 21:06 
GeneralStart Menu help [modified] Pin
Mabre of the Tadadas16-Mar-08 13:32
Mabre of the Tadadas16-Mar-08 13:32 
GeneralRe: Start Menu help Pin
Not Active16-Mar-08 14:00
mentorNot Active16-Mar-08 14:00 

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.