|
can any one help me in writing the code for a camera which is attached to a robot to recognize images with given measurements!
kamal9k@yahoo.co.uk
i have the partial code and i'll send it soon.
thanks.
|
|
|
|
|
You've got to be kidding! What are you paying for this help?
Let's see. You get outside help to put this system together and your company will recognize who? Will reward who? Will not even know, nor care about, the massive amount of help you received from who?
Try going to RentACoder.com and putting together a consulting contract. Ya ain't gonna find anyone here to do write this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
We are in here help only the person that have a problem with their existing code only. We do not code for any project, homework...
Try to do it by yourself and we could give you some idea or solution if you found any problem in your code.
|
|
|
|
|
i need to convert
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int _tmain()
{
unsigned char a1[16];
unsigned char a2[16];
unsigned int tempWRITE;
//FILE *in = fopen("c:/test.bin","r");
FILE *in = fopen("c:/test.bin","rb");
FILE *out = fopen("c:/new.txt","w");
while(!feof(in)) {
fread(a1,1,16,in);
a2[0] = a1[3];
a2[1] = a1[2];
a2[2] = a1[1];
a2[3] = a1[0];
a2[4] = a1[5];
a2[5] = a1[6];
a2[6] = a1[4];
a2[7] = a1[7];
a2[8] = a1[9];
a2[9] = a1[11];
a2[10] = a1[8];
a2[11] = a1[10];
a2[12] = a1[14];
a2[13] = a1[12];
a2[14] = a1[15];
a2[15] = a1[13];
fwrite(a2,1,16,out);
}
fclose(in);
fclose(out);
return 0;
}
1. Out of clutter, find simplicity.
2. From discord, find harmony.
3. In the middle of difficulty lies opportunity.
Albert Einstein
three rules of work
|
|
|
|
|
hi, well here is an atempt since i'm not that great at c++!
Public Sub t_Main()<br />
<br />
'declare the variables<br />
Dim a1(16) As Char<br />
Dim a2(16) As Char<br />
Dim tempWRITE As Integer<br />
<br />
'use streamreader to open file<br />
Dim fs As StreamReader = New StreamReader("c:/test.bin")<br />
'read file into a1<br />
fs.Read(a1, 0, 16)<br />
fs.Close()<br />
<br />
<br />
<br />
<br />
a2(0) = a1(3)<br />
a2(1) = a1(2)<br />
a2(2) = a1(1)<br />
a2(3) = a1(0)<br />
a2(4) = a1(5)<br />
a2(5) = a1(6)<br />
a2(6) = a1(4)<br />
a2(7) = a1(7)<br />
a2(8) = a1(9)<br />
a2(9) = a1(11)<br />
a2(10) = a1(8)<br />
a2(11) = a1(10)<br />
a2(12) = a1(14)<br />
a2(13) = a1(12)<br />
a2(14) = a1(15)<br />
a2(15) = a1(13)<br />
<br />
'use streamwriter to write file<br />
Dim sw As StreamWriter = New StreamWriter("c:/new.txt")<br />
'write a2 to file<br />
sw.Write(Convert.ToString(a2), 0, 16)<br />
sw.Close()<br />
<br />
End Sub
just call t_Main() in a procedure or click of a button!
should be nice and easy!
|
|
|
|
|
Thanks for the start but its out put is not right.
I am only getting the first line of the file. it is not a txt file but a .bin
if i try a text file it works fine. any help.
1. Out of clutter, find simplicity.
2. From discord, find harmony.
3. In the middle of difficulty lies opportunity.
Albert Einstein
three rules of work
-- modified at 22:48 Monday 23rd January, 2006
|
|
|
|
|
how do you mean the outputs not right? if you change new.txt to new.bin it should be the same, have you put Imports System.IO at the top of your code. I can help you if you give me a better description of the problem?
|
|
|
|
|
Hi,
I am creating a visual studio add-in.
And I want to add 2 projects to a solution.
But I'm having a problem...
If I try to edit the following MSDN code:
<br />
Sub SolutionExample(ByVal dte As DTE2) <br />
' This function creates a solution and adds a Visual C# Console <br />
' project to it. <br />
Try <br />
Dim soln As Solution2 = CType(DTE.Solution, Solution2) <br />
Dim csTemplatePath As String <br />
' This path must exist on your computer. <br />
' Replace <file path> below with an actual path. <br />
Dim csPrjPath As String = "<file path>" <br />
MsgBox("starting") <br />
' Get the project template path for a C# console project. <br />
csTemplatePath = soln.GetProjectTemplate _ <br />
("ConsoleApplication.zip", "CSharp") <br />
' Create a new C# Console project using the template obtained <br />
' above. <br />
soln.AddFromTemplate(csTemplatePath, csPrjPath, _ <br />
"New CSharp Console Project", False) <br />
MsgBox("done") <br />
Catch ex As System.Exception <br />
MsgBox(ex.ToString) <br />
End Try <br />
End Sub <br />
like this:
<br />
Sub SolutionExample(ByVal dte As DTE2) <br />
' This function creates a solution and adds a Visual C# Console <br />
' project to it. <br />
Try <br />
Dim soln As Solution2 = CType(DTE.Solution, Solution2) <br />
Dim csTemplatePath As String <br />
' This path must exist on your computer. <br />
' Replace <file path> below with an actual path. <br />
Dim csPrjPath As String = "<file path>" <br />
MsgBox("starting") <br />
' Get the project template path for a C# console project. <br />
csTemplatePath = soln.GetProjectTemplate _ <br />
("ConsoleApplication.zip", "CSharp") <br />
' Create a new C# Console project using the template obtained <br />
' above. <br />
soln.AddFromTemplate(csTemplatePath, csPrjPath, _ <br />
"New CSharp Console Project", False) <br />
MsgBox("done 1ste project") <br />
<br />
soln.AddFromTemplate(csTemplatePath, csPrjPath, _ <br />
"New CSharp Console Project 2", False) <br />
MsgBox("done 2de project") <br />
<br />
Catch ex As System.Exception <br />
MsgBox(ex.ToString) <br />
End Try <br />
End Sub <br />
it doesn't work, Visual studio says that the solution already exists...
Is there a possibilty to dynamically add 2 class libraries to a solution?
Tx
-- modified at 11:33 Monday 23rd January, 2006
|
|
|
|
|
Why do you need to add it dynamically?
|
|
|
|
|
Because I am making an automatic classgenerator. It automatically generates the classes from the selected SQL tables. So I need a class library for the autogenerated classes and I need another class library for the insert, update, delete ... statements. (I am programming 3 tier)
It works fine for just one class library but when I dynamically add another class library, visual studio says that the solution already exists and he can't create a second class library...
|
|
|
|
|
Hello,
I would like convert codes sources VB.NET into VB6. I have one application who uses components for VB6 only, so i can't migrate now to VB.NET
I saw good sources in your site ( like "http://www.codeproject.com/vb/net/autoupdate.asp") and i'm trying to use it in my application, but i have some problem with API/functions VB.NET.
Example :
How convert "Imports System.IO", "System.IO.StreamReader", "System.Net.WebClient", ...
What code must i use in VB6 ?
Thanks a lot for your help !
Bye
PS : sorry for my english, i'm french ...
-- modified at 11:27 Monday 23rd January, 2006
|
|
|
|
|
You'll have to re-write your application from scratch. VB6 doesn't have any equivalent to the constructs you listed.
You can pretty easily convert VB6 code to VB.NET, not definately not the other way around. It'll take some serious work to do that. For instance, VB6 has no native web access built in. You'll have to use an external control in VB6 to do the same thing, like downloading a web page. About the best you'll be able to get is the basic idea and steps behind the process of what you want to do. Converting the code is next to impossible.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, thanks for the answer !
I must find anothers things !
Bye
|
|
|
|
|
It might be possible to keep the VB.NET code and call it from VB6. Take a look at the VB Fusion section on MSDN.
http://msdn.microsoft.com/vbrun/vbfusion/[^]
I've never tried this myself. Nor want to. So, you're on your own from here.
-- modified at 13:21 Monday 23rd January, 2006
|
|
|
|
|
|
Hi,
Is it possible to use dll VB.NET in my application VB6 ?
If it's possible, how can i use it ?
I think that i need a new parameter for RemotePath in the class AutoUpdate ?
Thanks for your help !
|
|
|
|
|
It is possible. Go to the link I provided in my previous post. It contains several articles by Microsoft on how to do this.
|
|
|
|
|
In my opinion, it is impossible to do that.
|
|
|
|
|
Hi,
As far as i could think of it, why don't you convert the .NET code into a .NET Assembly (DLL) and register it in GAC so that you can use it in VB6 by adding it's reference into your VB6 project?
Hope that might help and if you find some better way then please post it on the forum.
With warm regards,
KEDAR
-- modified at 7:45 Wednesday 1st February, 2006
|
|
|
|
|
Hi,
We have find a good solution.
You can see it in french forum : http://www.developpez.net/forums/viewtopic.php?t=446317
And download source for VB6 here : http://thierry_aim.developpez.com/downloads/AutoUpdateExe.zip
Thanks for your help and interrest.
Bye
|
|
|
|
|
I'm trying to grab the share name (e.g.: \\server1\share) of an already mapped drive (Q:\). I've been looking for like a week on how to do this. I can disconnect drives, map drives and bring up the Win dialagos to do the same but I just can't find a way to grab that name. I just want to put it into a text box on the form Using vb.net on XP.
PLEASE HELP
thanks, N
-- modified at 14:06 Monday 23rd January, 2006
|
|
|
|
|
Something like this:
Private Const NO_ERROR = 0
Private Const ERROR_MORE_DATA = 234
Private Declare Auto Function WNetGetUniversalName Lib "mpr.dll" ( _
<MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> _
ByVal lpLocalPath As String, _
ByVal dwInfoLevel As INFO_LEVEL, _
ByVal lpBuffer As IntPtr, _
ByRef lpBufferSize As Integer _
) As Integer
Private Structure REMOTE_NAME_INFO
<MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> _
Public lpUniversalName As String
<MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> _
Public lpConnectionName As String
<MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> _
Public lpRemainingPath As String
End Structure
Private Enum INFO_LEVEL As Integer
UNIVERSAL_NAME_INFO_LEVEL = 1
REMOTE_NAME_INFO_LEVEL = 2
End Enum
Public Function GetUniversalName( _
ByVal Path As String, _
ByRef UniversalName As String, _
ByRef ConnectionName As String, _
ByRef RemainingPath As String) As Boolean
' When successful, returns TRUE with UniversalName,
' ConnectionName, and RemainingPath data. If not
' successful, it may be the drive is local and not mapped.
Dim buffer As Integer
Dim ptrbuffer As IntPtr
Dim status As Integer
Dim rni As REMOTE_NAME_INFO
Dim Success As Boolean
Dim SafteyCount As Integer = 0
UniversalName = ""
ConnectionName = ""
RemainingPath = ""
buffer = 1024
ptrbuffer = Marshal.AllocHGlobal(buffer)
status = WNetGetUniversalName( _
Path, INFO_LEVEL.REMOTE_NAME_INFO_LEVEL, _
ptrbuffer, buffer)
Do While True
Select Case status
Case NO_ERROR
rni = Marshal.PtrToStructure(ptrbuffer, GetType(REMOTE_NAME_INFO))
UniversalName = rni.lpUniversalName
ConnectionName = rni.lpConnectionName
RemainingPath = rni.lpRemainingPath
Success = True
Exit Do
Case ERROR_MORE_DATA
If SafteyCount > 3 Then
Success = False
Exit Do
End If
SafteyCount += 1
Marshal.FreeHGlobal(ptrbuffer)
ptrbuffer = Marshal.AllocHGlobal(buffer)
status = WNetGetUniversalName(Path, _
INFO_LEVEL.REMOTE_NAME_INFO_LEVEL, ptrbuffer, buffer)
Case Else
Success = False
Exit Do
End Select
Loop
Marshal.FreeHGlobal(ptrbuffer)
Return Success
End Function
Hope that helps
progload
|
|
|
|
|
Thanks !!
|
|
|
|
|
I've inherited a VB6 app with a TreeView.
The child nodes are loaded when the parent is expanded.
It all works except that part of the tree can be recursive (A parent of B parent of C parent of A).
If a user selects node A and presses * on the keypad the tree tries to expand all of A's tree thus ending up in an infinite recursion.
How can I trap this (eat the * or expand only 1 level).
TIA
PeteB
I wouldn't say "he's not the sharpest knife",
I'd say "he's a spoon."
|
|
|
|
|