Click here to Skip to main content
15,895,772 members
Home / Discussions / C#
   

C#

 
AnswerRe: problem in saving an image in windows application Pin
amit293917-Jun-13 1:10
amit293917-Jun-13 1:10 
QuestionConvert Latitude Longitude To X Y Pixel (C#) Pin
zerozaaa6-Jun-13 18:26
zerozaaa6-Jun-13 18:26 
AnswerRe: Convert Latitude Longitude To X Y Pixel (C#) Pin
Eddy Vluggen6-Jun-13 23:54
professionalEddy Vluggen6-Jun-13 23:54 
QuestionInternet Security Pin
MAW306-Jun-13 13:25
MAW306-Jun-13 13:25 
AnswerRe: Internet Security Pin
Dave Kreskowiak6-Jun-13 16:21
mveDave Kreskowiak6-Jun-13 16:21 
AnswerRe: Internet Security Pin
Eddy Vluggen6-Jun-13 23:46
professionalEddy Vluggen6-Jun-13 23:46 
AnswerRe: Internet Security Pin
Abhinav S7-Jun-13 19:06
Abhinav S7-Jun-13 19:06 
QuestionLogitech G27 Steering Wheel input in C# Pin
razvan_grebla6-Jun-13 10:43
razvan_grebla6-Jun-13 10:43 
Hello everyone,

I tried to get the input data (wheel, acceleration , break values, etc)from my Logitech G27 steering wheel in a C#.


I read a some articles about joysticks, and controllers (e.g. PS, XBOX), like: Interfacing with a Joystick using C# By M Harris.


I've implemented the following class (like in the example above):
C#
public WeelG27(Control ParentControl)
    {
        try
        {
            // Find all the GameControl devices that are attached.
            DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl,
                                                                EnumDevicesFlags.AttachedOnly);

            // Verify if there are gamecontroller attached
            if (gameControllerList.Count > 0)
            {

                foreach (DeviceInstance devInst in gameControllerList)
                {
                    if (devInst.DeviceType == DeviceType.Driving && devInst.ProductName.Contains("Logitech G27 Racing Wheel USB"))
                    {
                        Wheel = new Device(devInst.InstanceGuid);
                        Wheel.SetCooperativeLevel(ParentControl, CooperativeLevelFlags.Background | CooperativeLevelFlags.Exclusive);
                        Wheel.SetDataFormat(DeviceDataFormat.Joystick);
                        Wheel.Properties.AxisModeAbsolute = true;
                        Wheel.Properties.AutoCenter = false;
                        Wheel.Acquire();                        
                    }
                }
            }

            if (Wheel == null)
            {
                throw new NotImplementedException();
            }

        }

        catch (Exception Ex)
        {
            MessageBox.Show("WeelG27() Constructor error!\n" + Ex.Message + "\n" + Ex.StackTrace);
        }
    }


Problems:
- After acquiring the device, the wheel cannot be moved (it is blocked and moves maximum 10 degrees left and right from center).
- Tried to set the Cooperative Level to Foreground (use the wheel only when application is active) but Poll() function throws an error when the tool is still pooling (thread or timer).


Does anyone had this problems? Solved this problems, or know how to solve them? Smile | :)


I would appreciate also some tips (or start points) on how:
- to move the wheel to different positions (from the tool).
- set different wheel properties (e.g. steering wheel maximum rotation angle or combine axes).
- make a mechanism so that I can assign dynamical button functionality (like in most games, you can choose what buttons you use to set different actions e.g. Wheel Button 1 -> Start Motor).



Thank you for help!
Razvan

QuestionWebcam Application Pin
Bishwajit Nepali6-Jun-13 6:23
Bishwajit Nepali6-Jun-13 6:23 
AnswerRe: Webcam Application Pin
Dave Kreskowiak6-Jun-13 7:43
mveDave Kreskowiak6-Jun-13 7:43 
GeneralRe: Webcam Application Pin
Bishwajit Nepali6-Jun-13 8:54
Bishwajit Nepali6-Jun-13 8:54 
GeneralRe: Webcam Application Pin
Dave Kreskowiak6-Jun-13 10:08
mveDave Kreskowiak6-Jun-13 10:08 
QuestionCalling RPG program or Query using odbc connection to AS400 Pin
Kiko.176-Jun-13 1:42
professionalKiko.176-Jun-13 1:42 
AnswerRe: Calling RPG program or Query using odbc connection to AS400 Pin
Keith Barrow6-Jun-13 2:36
professionalKeith Barrow6-Jun-13 2:36 
GeneralRe: Calling RPG program or Query using odbc connection to AS400 Pin
Kiko.176-Jun-13 16:32
professionalKiko.176-Jun-13 16:32 
QuestionXML Upload Pin
Member 97011655-Jun-13 23:59
Member 97011655-Jun-13 23:59 
AnswerRe: XML Upload Pin
Eddy Vluggen6-Jun-13 0:38
professionalEddy Vluggen6-Jun-13 0:38 
GeneralRe: XML Upload Pin
Member 97011656-Jun-13 0:43
Member 97011656-Jun-13 0:43 
GeneralRe: XML Upload Pin
Dave Kreskowiak6-Jun-13 2:10
mveDave Kreskowiak6-Jun-13 2:10 
GeneralRe: XML Upload Pin
OriginalGriff6-Jun-13 8:12
mveOriginalGriff6-Jun-13 8:12 
GeneralMy vote of 1 Pin
Keith Barrow6-Jun-13 2:48
professionalKeith Barrow6-Jun-13 2:48 
QuestionExcel Spreadsheet formatting via OfficeOpenXml Pin
matt_1ca5-Jun-13 22:49
matt_1ca5-Jun-13 22:49 
AnswerRe: Excel Spreadsheet formatting via OfficeOpenXml Pin
Richard MacCutchan5-Jun-13 23:32
mveRichard MacCutchan5-Jun-13 23:32 
GeneralRe: Excel Spreadsheet formatting via OfficeOpenXml Pin
matt_1ca8-Jun-13 22:32
matt_1ca8-Jun-13 22:32 
Questionc# error with database query transactions Pin
User34905-Jun-13 22:35
User34905-Jun-13 22:35 

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.