|
comment faire un projet paint avec animation en xaml et c#
|
|
|
|
|
|
Yeah, I had no idea what he was posting and, frankly, putting my name in a subject line was creepy as hell.
|
|
|
|
|
I deleted the other two posts before this went all Single White Female.
This space for rent
|
|
|
|
|
Can VB.Net allow to create drill down for datagridview in windows application ?
modified 25-May-16 2:32am.
|
|
|
|
|
|
Hi,
I'm wondering if any of you know what is the maximum number of .NET Framework CLR Runtimes that can be installed on a computer ?
I'm writing an application, that loads a specific Runtime, and, the first function I wrote enumerates through the installed Runtimes, using the ICLRMetaHost, IEnumUnknown, and ICLRRuntimeInfo interfaces. This function works correctly (I have two installed runtimes on my computer).
Thanks for any information.
|
|
|
|
|
As far as I'm aware:
- 1.0 and 1.1 were separate CLRs, but only came in 32-bit versions;
- 2.0 has both 32- and 64-bit versions;
- 3.0 and 3.5 used the same CLR as 2.0;
- 4.0 has both 32- and 64-bit versions;
- 4.5 and 4.6 are in-place upgrades to 4.0;
So depending on whether you count 32- and 64-bit CLRs separately, the answer is either 4 or 6 (at the moment).
Of course, if Microsoft ever decide to release a new version of the framework that isn't an in-place upgrade to 4.0, the answer will change.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Why would there be a maximum?
|
|
|
|
|
Richard Deeming and Dave Kreskowiak,
Hey, thanks for the information. Yeah, I should have mentioned either 32-bit or 64-bit versions (my app is a 32-bit version running on WOW64). More than anything, I'm just curious,...
|
|
|
|
|
Hi guys,
I got new project that I need to finish asap and I'm almost done, my app is working perfect but now I have problem which I have to fix asap. Problem is with connecting to mysql database ( remote ). My database server is installed on one server which have static IP, given by my routers DHCP, and i dont have any problem connecting when im in my WORKGROUP. now my question is, is it possible that i predefine in my connection string so i can connect to that database when im at my home ( so i do not have to connect to vpn manualy ). ?
here is my conn string
dim konekcija as new sqlconnection
konekcija.connectionString =
"Data Source=SERVER IP,PORT;Network Library=DBMSSOCN;Initial Catalog=MYDATABASE;User ID=USERNAME;Password=MYPASS;>"
|
|
|
|
|
If you're talking about connecting to your MySQL server from outside of your network and you need to connect VPN first to get at it, there is NOTHING you can put in the connection string that will change that. You will still have to connect VPN manually first. The DbConnection objects don't know anything about connecting a VPN first.
|
|
|
|
|
Thank you for you answer now i can stop searching.
Thank you again
|
|
|
|
|
Quote: My application creates a chart in Excel, then exports the chart as a .png file.
It works fine the first time i generate a chart, But when i do it a second time i get this error.
An unhandled exception of type System.Runtime.InteropServices.ExternalException; occurred in System.Drawing.dll
Additional information: A generic error occurred in GDI+
Code where i get an error.
Dim workbook As New Workbook()
workbook.LoadFromFile("Test.xls")
Dim sheet As Worksheet = workbook.Worksheets(0)
Dim imgs As Image() = workbook.SaveChartAsImage(sheet)
imgs(0).Save(String.Format("img-0.png", ImageFormat.Png))
Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox2.TabIndex = 1
Me.PictureBox2.TabStop = False
PictureBox2.Image = Image.FromFile("img-0.png")
|
|
|
|
|
I would check that the "img-0.png" file is not still in use when you are trying to create the second chart.
I.e. It's properly disposed of before you attempt to create another image with the same name.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
This is a known problem with the Image.FromFile method:
This occurs when you set the Image property of a PictureBox control to a file manually at design time, or when you use the FromFile method at run time.
The workaround is to use the Image.FromStream method instead:
Using fs As Stream = System.IO.File.OpenRead("img-0.png")
PictureBox2.Image = Image.FromStream(fs)
End Using
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi there,
I try to use a code from your site: href="http://www.codeproject.com/Articles/617613/Fast-pixel-operations-in-NET-with-and-without-unsa
in VB.NET.
I get: a system overflow exception in my code below.
Quote: Dim diffR As Integer = CInt(pixelR - searchedR) '<=================
' pixelR is 128, searchedR is 0
I assume, that the code is correct where the exception pops up. Can you have a look at my code?
Thanks for any help
Bernd
<blockquote class="quote"><div class="op">Quote:</div>Function true_Black_and_White_Unsafe_Methode( _
MyImage As Image,
searchedR As Byte, searchedG As Byte, searchedB As Byte, _
Tolerance As Integer) As Image
' Source:
' http://www.codeproject.com/Articles/617613/Fast-pixel-operations-in-NET-with-and-without-unsa
Dim Bmp8 As New Bitmap(MyImage.Width, MyImage.Height, PixelFormat.Format1bppIndexed)
Dim imageData As BitmapData = Bmp8.LockBits(New Rectangle(0, 0, MyImage.Width, _
MyImage.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb)
Dim bytesPerPixel As Integer = 3
Dim scan0 As Integer = imageData.Scan0
Dim stride As Integer = imageData.Stride
Dim unmatchingValue As Byte = 0
Dim matchingValue As Byte = 255
Dim toleranceSquared As Integer = Tolerance * Tolerance
Dim y As Integer
For y = 0 To imageData.Height - 1
Dim row(scan0 + (y * stride)) As Integer
Dim x As Integer
For x = 0 To imageData.Width - 1
' Watch out for actual order (BGR)!
Dim bIndex As IntPtr = x * bytesPerPixel
Dim gIndex As IntPtr = bIndex + 1
Dim rIndex As IntPtr = bIndex + 2
Dim pixelR As Byte = row(rIndex)
Dim pixelG As Byte = row(gIndex)
Dim pixelB As Byte = row(bIndex)
' here is the system overflow exception
Dim diffR As Integer = CInt(pixelR - searchedR) '<=================
' pixelR is 128, searchedR is 0</blockquote>
Dim diffR As Integer = CInt(pixelR - searchedR) '<=================
' pixelR is 128, searchedR is 0
Dim diffG As Integer = CInt(pixelG - searchedG)
Dim diffB As Integer = CInt(pixelB - searchedB)
Dim distance As Integer = diffR * diffR + diffG * diffG + diffB * diffB
If distance > toleranceSquared Then
row(rIndex) = row(bIndex) = row(gIndex) = unmatchingValue
Else
row(rIndex) = row(bIndex) = row(gIndex) = matchingValue
End If
Next
Next
Bmp8.UnlockBits(imageData)
Return Bmp8
End Function</blockquote>
|
|
|
|
|
Articles are support by the people that write them. Articles are written by volunteers, not the staff of CodeProject.
At the bottom of the article there is a forum, just like this one. Ask your question there.
|
|
|
|
|
Good afternoon to everyone. First of all i'm sorry if my question might seem stupid but please understand me....i'm not a very practice programmer!!
THIS IS MY ACTUAL SITUATION:
In this moment i've a program (ABC) not created by me.This program expose a COM interface. This program has different function and every function is holded is a particular secondary form.
If I start a new VB.NET project and then I add a reference to the executable file of the program above (ABC) my VisualStudio imports the interop of the program. Than using the CreateObject Function I can access to some Function of the executable file. This allow me to send some string from my own program (FGH written in VB6) to the other one (ABC).
THIS SHOULD BE MY NEW SITUATION:
Now, I made a new program NEWABC(similar to the old ABC) but the form will be opened with Process.Start so instead having only one process as in ABC i will have as many processes are the Windows opened. Now, from the older FGH a from a newer NEWFGH (written in .NET) i would like to find a particular process launched by NEWABC and send him a particular string. I could do this operation using Drag&Drop but this operation is to slow because I would like that clicking a control button he made everything in 1ms.
Does anyone have some idea to recommend me?
Thany you very much
Jack
|
|
|
|
|
You can send information between .NET processes using pipes.
Since you just need to send an object to the process, you shouldn't need a named pipe.
A fair starter point is at:
https://msdn.microsoft.com/en-us/library/bb762927(v=vs.110).aspx
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Thank you very much Benjamin for your reply.
From Yesterday evening I got 2 illuminations and I found two solutions to my problem.
The first solution I found was using the 2 user32.dll function (GetForegroundWindow and GetWindowText) to retrieve the correct window i need to post message and then send the message throught the user32 function SetWindowText. In This way thorught the events TextChange of my second application I was able to get the message. But I didn't love so much this solution so i found this other one.
The second solution as been found on codeproject to this link Send strings to another application by using Windows messages[^]
I made a dll that will be imported in all my applications and in this way i'm able to get message.
I knew that throught pipe were possible to solve my problem but I afraid that my friend will not be able to use pipe in VB6 so I needed to find a solution also usable throught VB6......
|
|
|
|
|
VB6 can use named pipes. It's just not supported in anything convenient like it is in the .NET Framework. He'll just have to build his own VB6 code implementation on top of Windows function calls to make his support for it.
|
|
|
|
|
JackMisani wrote: Thank you very much Benjamin for your reply.
His name's Nathan. The bit at the bottom of the message is his "signature", which is a quote from Benjamin Disraeli[^]; he's not actually the 1st Earl of Beaconsfield.
Similarly, I am not Homer[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I was willing to let him believe that.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Hi,
i wrote a small vb.net console application for sending emails to a gmail-account.
The application works fine on my developement-system ( wondows 10).
When i distribute the application to Windows server 2012 r2 the app did not send the email, the app termine without error but the email was not send.
i try allready to switch firewall off, but without success.
Anybody has a idea what can be wrong?
The code loke like this:
Imports System.IO
Imports System.Net.Mail
Imports System.Net
Sub Main()
Try
Dim loMessage As MailMessage = Nothing
Dim loClient As SmtpClient = Nothing
loClient = New SmtpClient()
loClient.Timeout = 50000
loClient.Host = "smtp.gmail.com"
loClient.Port = 587
loClient.EnableSsl = True
loClient.Credentials = New System.Net.NetworkCredential("test@gmail.com", "xxxxxxxxxx")
loMessage = New MailMessage()
loMessage.IsBodyHtml = True
loMessage.From = New MailAddress("xxxxxx@gmail.com")
loMessage.To.Add(New MailAddress("xxxxxx@bluewin.ch"))
loMessage.Subject = "Betreff"
loMessage.Body = "Test Ihre Daten..."
loClient.Send(loMessage)
Catch ex As Exception
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter("c:\tmp\err.txt", True)
file.WriteLine(ex.ToString)
file.Close()
End Try
End Sub
|
|
|
|