|
 |
|
08-02-2008, 02:07 PM
|
#16
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
Quote: Originally Posted by Enforcer 
Please don't use AI.
ok
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
08-03-2008, 10:12 AM
|
#17
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
Quote: Originally Posted by guino 
If you haven't done that yet, you should be able to export the class into a .tlb file using "regasm /codebase /tlb P2140API.dll" then load it up to use it with the extension plugin sources.. or you could simply edit their demo in C# and have it send commands to RR regularly to set variables with the desired values -- just suggestions of course.
ok, i've got the P2140API.dll exported to P2140API.tlb...
I've looked through the example plugin, and it looks like for all my labels, I would use this code:
Code:
'*****************************************************************
'* This Function will be called with a requested label code and
'* format specified at the skin file. Simply return any text to
'* be displayed for the specified format.
'*****************************************************************
Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String
Select Case LCase(LBL)
Case "mylabel"
'This example returns a "hello" text to show it works
ReturnLabel = "Hello from Extension!"
'Specify whatever and whichever labels you wish to create
'You can add as many as you'd like, and you can process complex labels as long
'as you parse them yourself (i.e. "mycomplexlabel;parameter")
'Case "mycommand2"
'Insert Command code here
End Select
End Function
So first I have to reference the codes from the API, then send those codes as a label to RR with returnlabel right? How do I reference the API in the code?
so if I want to turn Batt_V (from P2140API) into psuBATT_V (in RR) the code might look something like this:
Code:
Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String
Select Case LCase(LBL)
Case "psuBATT_V"
ReturnLabel = $Batt_V
End Select
End Function
As long as I create the $Batt_V variable from the Batt_V command right?
Or, am I way off base?
|
|
|
08-03-2008, 12:03 PM
|
#18
|
|
Confusion Master
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 11,938
|
Yep, you seem to have the idea.
|
|
|
08-03-2008, 02:39 PM
|
#19
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
Quote: Originally Posted by Enforcer 
Yep, you seem to have the idea.
Thanks, I feel like I might have a grasp on this, but then again, a fellow forum member had an idea about solar panels, it's all about the practice though. If I can't practice the idea, it means nothing.
I think I can get it, but how do I reference the P2140API.dll in the code so that the variables actually work?
Last edited by monkeyracer; 08-03-2008 at 02:48 PM.
|
|
|
08-03-2008, 03:11 PM
|
#20
|
|
Confusion Master
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 11,938
|
Have you
1. registered te dll
2. added it in Project --> references
?
|
|
|
08-03-2008, 03:56 PM
|
#21
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
Quote: Originally Posted by Enforcer 
Have you
1. registered te dll
2. added it in Project --> references
?
1. can not find entry point... i think, I'll have to check again,
2. nope, will do...
thanks....
|
|
|
08-03-2008, 07:54 PM
|
#22
|
|
Confusion Master
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 11,938
|
Which VB are you doing this in, it looks like it needs VB .net as it requires .NET 2.0
|
|
|
08-03-2008, 08:29 PM
|
#23
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
I added the .dll as a resource, but it still couldn't find the entry point to register it...
I'm using the free Visual Basic 2008 Express Edition with the .net 3.5 framework...
Also, Visual C# 2008 Express Edition, since the API was done in c#.
------------------------------------------------------------
I think I've got the beginnings of the plugin started:
Code:
Option Strict Off
Option Explicit On
<System.Runtime.InteropServices.ProgId("RRExtension_NET.RRExtension")> Public Class RRExtension
Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String
Select Case LCase(LBL)
Case "psuBATT_V"
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_V"
Case "psuBATT_C"
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C"
End Select
End Function
So theoretically, if this were all I needed for codes, In RR, I could use this:
Code:
L01,20,429,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_V","CENTER"
L01,20,489,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_C","CENTER"
with the "X,PSUmonitoRR" extension referenced in menu.skin
Right?
Is the
Code:
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C"
in the right syntax? or should it have a $ in front of the p2140? and with or without quotes?
Code:
ReturnLabel = "$P2140.P2140Board.cbP2140.Batt_C"
Sorry if that's a noob question, but I've so far had about 30 minutes of experience with VB and/or C# etc...
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
08-05-2008, 09:33 AM
|
#24
|
|
RoadRunner Mastermind
Join Date: Nov 2004
Location: Vitória, ES - Brazil
Posts: 9,064
|
You're in the right track... I have never tried to make an extension plugin with VS2008, but it should be possible.
You don't have to add the DLL to the references of the project, instead, you add the TLB you made and it should give you access to the classes/objects of the DLL -- so you'll be able to create the objects defined in the class to read the data from the PSU.
__________________
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
|
|
|
08-05-2008, 09:39 AM
|
#25
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,307
|
Quote: Originally Posted by monkeyracer 
I added the .dll as a resource, but it still couldn't find the entry point to register it...
I'm using the free Visual Basic 2008 Express Edition with the .net 3.5 framework...
Also, Visual C# 2008 Express Edition, since the API was done in c#.
------------------------------------------------------------
I think I've got the beginnings of the plugin started:
Code:
Option Strict Off
Option Explicit On
<System.Runtime.InteropServices.ProgId("RRExtension_NET.RRExtension")> Public Class RRExtension
Public Function ReturnLabel(ByRef LBL As String, ByRef FMT As String) As String
Select Case LCase(LBL)
Case "psuBATT_V"
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_V"
Case "psuBATT_C"
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C"
End Select
End Function
So theoretically, if this were all I needed for codes, In RR, I could use this:
Code:
L01,20,429,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_V","CENTER"
L01,20,489,101,33,#FRed#,#FGreen#,#FBlue#,20,"BankGothic Md BT","psuBATT_C","CENTER"
with the "X,PSUmonitoRR" extension referenced in menu.skin
Right?
Is the
Code:
ReturnLabel = "P2140.P2140Board.cbP2140.Batt_C"
in the right syntax? or should it have a $ in front of the p2140? and with or without quotes?
Code:
ReturnLabel = "$P2140.P2140Board.cbP2140.Batt_C"
Sorry if that's a noob question, but I've so far had about 30 minutes of experience with VB and/or C# etc...
shouldnt need the $, and definitely no quotes. Quotes are only used for strings not variables. That all looks like it should work aside from that. Test it. Run it in RR with debug=TRUE and see what error message if any you get. If you get the activeX message your .dll is not communicating with RR .. probably because of the issue we discussed (cant register COM in the free version). If u'd like i can send you a source of RRFusion done in VB2008 so u can see the proper formatting.. but it looks like u've got a good grasp of it all.
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
Last edited by Sonicxtacy02; 08-05-2008 at 09:42 AM.
|
|
|
08-05-2008, 09:59 AM
|
#26
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
Quote: Originally Posted by guino 
You don't have to add the DLL to the references of the project, instead, you add the TLB you made and it should give you access to the classes/objects of the DLL -- so you'll be able to create the objects defined in the class to read the data from the PSU.
When I try, I get the error:
Quote:
A reference to 'C:\P2140API.tlb' could not be added.
The ActiveX type library 'C:\P2140API.tlb' was exported from a .NET assembly and cannot be added as a reference.
Add a reference to the .NET assembly instead.
I added the .dll as a reference and it seems it reads it.
Quote: Originally Posted by Sonicxtacy02 
shouldnt need the $, and definitely no quotes. Quotes are only used for strings not variables. That all looks like it should work aside from that. Test it. Run it in RR with debug=TRUE and see what error message if any you get. If you get the activeX message your .dll is not communicating with RR .. probably because of the issue we discussed (cant register COM in the free version). If u'd like i can send you a source of RRFusion done in VB2008 so u can see the proper formatting.. but it looks like u've got a good grasp of it all.
I tried it without the quotes, and it "squiggly-blue-underlined" the "P2140.P2140Board.cbP2140.Batt_V" meaning some syntax is missing.
|
|
|
08-05-2008, 10:27 AM
|
#27
|
|
Terminal flasher
Join Date: Sep 2004
Location: Woodbridge, VA
Posts: 6,307
|
that means either that func in the dll is not public SHARED or its typed wrong. If you erase and type the first few characters the tooltip should appear to complete the rest of the line. Does that happen?
__________________
03 Acura RSX Coupe
Developer of: RRFusion, MovieTimes.NET, (new)RRMail, RRShoutcast, & RRVehicle Maintenance
Currently working on: RRVehicle Maintenance
|
|
|
08-05-2008, 10:41 AM
|
#28
|
|
Wants to make it harder
Join Date: May 2007
Location: Lakehood, CO
Posts: 1,414
|
"Reference to a non-shared member requires an object reference"
|
|
|
08-06-2008, 04:50 PM
|
#29
|
|
Maximum Bitrate
Join Date: Nov 2006
Location: Wales, UK
Posts: 787
|
Quote: Originally Posted by monkeyracer 
a fellow forum member had an idea about solar panels
That guys a legend
__________________
CarPuter Progress:
Planning:-----> [||||||||||] 100%
Hardware Buying:-> [||||||||||] 100%
Software:-----> [||||||||||] 100%
Installing:-----> [||||||||||] 100%
Current Project= Making skins in photoshop...
|
|
|
09-20-2008, 09:24 PM
|
#30
|
|
Newbie
Join Date: Mar 2008
Posts: 40
|
Any updates on this? How are you coming along??
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:46 AM.
| |