Sending trigger through parallel port, C++, Visual Studio 2010, Windows 7

Hi, I have a problem that I am really stuck with, and I am novice to the task so any help would be extremely helpful.
I an trying to write to parallel port on my PC in order to send a trigger to EEG recording machine every time the new goal appears in a Virtual Reality game that I wrote in C++ (I want to record EEG brain signals while subjects are playing the game).
I tried to follow the instructions from here: http://msdn.microsoft.com/en-us/library/ff802693.aspx
I wrote the following code:
BOOL FileExists(LPCTSTR szPath)
DWORD dwAttrib = GetFileAttributes(szPath);
return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
BOOL WriteABuffer(char * lpBuf, DWORD dwToWrite)
OVERLAPPED osWrite = {0};
DWORD dwWritten;
DWORD dwRes;
BOOL fRes;
// Create this write operation's OVERLAPPED structure's hEvent.
osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (osWrite.hEvent == NULL)
// error creating overlapped event handle
return FALSE;
// Issue write.
if (!WriteFile(ghComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
if (GetLastError() != ERROR_IO_PENDING) {
// WriteFile failed, but isn't delayed. Report error and abort.
fRes = FALSE;
else
// Write is pending.
dwRes = WaitForSingleObject(osWrite.hEvent, INFINITE);
switch(dwRes)
// OVERLAPPED structure's event has been signaled.
case WAIT_OBJECT_0:
if (!GetOverlappedResult(ghComm, &osWrite, &dwWritten, FALSE))
fRes = FALSE;
else
// Write operation completed successfully.
fRes = TRUE;
break;
default:
// An error has occurred in WaitForSingleObject.
// This usually indicates a problem with the
// OVERLAPPED structure's event handle.
fRes = FALSE;
break;
else
// WriteFile completed immediately.
fRes = TRUE;
CloseHandle(osWrite.hEvent);
return fRes;
I get none of the specified errors, but game fails to start and it seems nothing gets written to parallel port. Any suggestions on how to proceed from here would be more than appreciated.
Thank you, Joanna

Hi, I have a problem that I am really stuck with, and I am novice to the task so any help would be extremely helpful.
I an trying to write to parallel port on my PC in order to send a trigger to EEG recording machine every time the new goal appears in a Virtual Reality game that I wrote in C++ (I want to record EEG brain signals while subjects are playing the game).
I tried to follow the instructions from here: http://msdn.microsoft.com/en-us/library/ff802693.aspx
I wrote the following code:
BOOL FileExists(LPCTSTR szPath)
DWORD dwAttrib = GetFileAttributes(szPath);
return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
BOOL WriteABuffer(char * lpBuf, DWORD dwToWrite)
OVERLAPPED osWrite = {0};
DWORD dwWritten;
DWORD dwRes;
BOOL fRes;
// Create this write operation's OVERLAPPED structure's hEvent.
osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (osWrite.hEvent == NULL)
// error creating overlapped event handle
return FALSE;
// Issue write.
if (!WriteFile(ghComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
if (GetLastError() != ERROR_IO_PENDING) {
// WriteFile failed, but isn't delayed. Report error and abort.
fRes = FALSE;
else
// Write is pending.
dwRes = WaitForSingleObject(osWrite.hEvent, INFINITE);
switch(dwRes)
// OVERLAPPED structure's event has been signaled.
case WAIT_OBJECT_0:
if (!GetOverlappedResult(ghComm, &osWrite, &dwWritten, FALSE))
fRes = FALSE;
else
// Write operation completed successfully.
fRes = TRUE;
break;
default:
// An error has occurred in WaitForSingleObject.
// This usually indicates a problem with the
// OVERLAPPED structure's event handle.
fRes = FALSE;
break;
else
// WriteFile completed immediately.
fRes = TRUE;
CloseHandle(osWrite.hEvent);
return fRes;
I get none of the specified errors, but game fails to start and it seems nothing gets written to parallel port. Any suggestions on how to proceed from here would be more than appreciated.
Thank you, Joanna

Similar Messages

  • Problem when adding ABAP custom webservice with Visual Studio 2010

    Hi All,
    After creating a webservice for a custom RFC function developed in a ECC6.0 SAP machine, I tried to add it to a Visual Studio 2010 windows aplication (through a web reference connection).
    The sequence I've done is:
    - Create RFC in ABAP, with testing ok
    - Create a WEBSERVICE with the ABAP editor
    - Configured the webservice with SICF with:
         Procedure: Standard
         Logon data: standard R3 user
         Security requirement: Standard
         Authentication: Standard SAP User
    Then, in SOAMANAGER I copied the webservice URL and tried to add it to Visual Studio 2010, but it keeps asking me the user and password. I try to supply the R3 username and password but if fails.
    Why is ECC6.0 asking the user and passord if I've defined a SAP user for the login process?
    Is there any way to disable this?
    Thanks,
    Manuel Dias

    Hello Manuel,
    You can use the following code:
    CredentialCache cache = new CredentialCache();
          cache.Add(new Uri("WEBSERVICEURL:PORTNUMBER/"), "Basic", new NetworkCredential("USERNAME", "PASSWORD"));
    SAP needs a password.
    Kind regards,
    JK

  • Problem in sending data to parallel port

    Hello,
    I can open a parallel port (LPT1) using java comm api i,e javax.comm.
    but problem in sending data to parallel port,
    I choose the appropriate port(LPT1), it is in bi-directional mode according to BIOS configuration.
    but according to the java program the mode is SSP.
    when i write data to parallel port the volt-meter give a reading of high state for all data pin (pin1 to 9) i,e the parallel port doesnot change state. I am using windows XP.
    What is the solution?

    try it on Open Solaris 10 or Linux platform.
    also just try using the new FileWriter("LPT1").write("Hello");
    on windows platform
    Pravin

  • How to create a site column through Visual Studio 2010?

    I was trying to create lists, content type and site columns through Visual Studio 2010. But I could not figure out how to add site column? What item do I need to add for this and what kind of coding is to be done?

    Try this
    1. Create a Empty project in Visual studio.
    2.The Empty SharePoint Project template does not include any Features in the Features folder. To add a new Feature to this project, right -click the Features folder, and click Add Feature. This adds a new Feature component to the folder; double – click the
    Feature1 icon in Solution Explorer to modify the Feature ’ s
    metadata using the Feature designer. The Title and Description values appear on the Features pages in Site settings. It is a good idea to make these values
    descriptive so that administrators will know what they are adding to the site when they activate the feature.
    The feature ’ s scope determines where the feature can be activated within SharePoint. Please Note – Certain components, such as site columns, content types, Master pages, and Page Layouts, are installed at the site collection level and made available to all
    sites within the collection. These components require that the scope for the feature be set to “ Site. ”
    3. Next, add a new item to the project (Right – click project name ➪ Add ➪ New Item) and select the Empty Element template from the Add New Item dialog box.
    The Empty Element template is an XML fi le where you can enter CAML Field definitions.
    Following is what you will add in your elements.xml file –
    < Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
    < Field ID="{76C140E1-D827-433B-AD38-257F9594B846}"
    Name="CustomCol"
    DisplayName="My Custom Site Column"
    Group="Custom group"
    Type="Text"
    Required="FALSE"/ >
    < Field ID="{5F516D92-969C-4661-81B9-C9210E2A2FDC}"
    Name="Choice Type"
    DisplayName="My Choice Type"
    Group="Custom group"
    Type="Choice"
    Required="FALSE" >
    < CHOICES >
    < CHOICE > Medical < /CHOICE >
    < CHOICE > Dental < /CHOICE >
    < CHOICE > Vision < /CHOICE >
    < CHOICE > Insurance < /CHOICE >
    < /CHOICES >
    < /Field >
    < /Elements >
    4. To deploy the Site Columns defined in the Elements file, right – click the project name in the Visual Studio Solution Explorer, and select Deploy. This will deploy the solution file to the solution store and activate the Feature in the targeted site collection.

  • Visual Studio 2010 64bit cann't connect Oracle database through 64bit ODBC Driver

    Hi,
    I am developing an 64bit And-In software. My OS is windows7 64bit Ultimate. Developer tool is
    Microsoft  Visual Studio 2010 Ultimate 64bit any-CUP.
    Server is SUN server and Oracle database 10.2.0.5 64bit enterprise edition.
    I have installed instantclient-odbc-win64-10.2.0.5 on my computer.
    I am able to connect through the command line sqlplus user/pass@server.
    In date source(c:\windows\system32\odbcad32.exe), ODBC Driver connection successful.
    But in VS2010 C#, use Tools -> Connect Database,I get an error 193 (Oracle in
    instantclient10_2,c:\ora10_64\SQORA32.dll) cann't be loaded.
    SQORA32.dll is 32bit ODBC Driver or 64bit ODBC Driver?
    How can I connect database with vs2010 64bit?
    Regards

    There is no Visual Studio 2010 Ultimate 64bit as far as I know.  It's a 32 bit app.    Generally you'd need to install a 32 bit client to use the 32 bit tools.
    Hope it helps,
    Greg

  • Led glow through parallel port.

    Hi,
    My status port of parallel port goes to default when no action is performed i have put that in a while loop..  how to solve that in Labview. I need to access status port S3,s4,s6,s7,s5 and the out put is connected to the data port of parallel port. when i press s3, the LED of data port glow's for a while and then when i release the s3 button it goes to default value,which i don't want it to happen.
    I basically want to glow a led through parallel port and it should remain on even if i try to glow another led through parallel port. the staus port of parallel port will give input to the pc and data port receives the output(data port has 7 leds).
    Can anyone help me out with this.
    Thanks.

    Basically need to modify the last part..
    Attachments:
    Copy of Fantansy House3.vi ‏693 KB

  • Visual Studio 2010 Sending a fully html email.

    I would like to send a fully html email via Visual Studio, is this possible?

    Here you go.
    This is my old code for sending email on VB6. Unfortunately I don't have the reference of it.
    you can download the required dll and OCX from the link below.
    Please download them, the link will not be valid after Jan 01, 2015
    also you need to read the code below and do some modification based on the objects on your form.
    Please pay attention to the required reference as well.
    Link
    ' Required declaration of the vbSendMail component (withevents is optional)
    ' You also need a reference to the vbSendMail component in the Project References
    Private WithEvents poSendMail As vbSendMail.clsSendMail
    Attribute poSendMail.VB_VarHelpID = -1
    ' misc local vars
    Dim bAuthLogin As Boolean
    Dim bPopLogin As Boolean
    Dim bHtml As Boolean
    Dim MyEncodeType As ENCODE_METHOD
    Dim etPriority As MAIL_PRIORITY
    Dim bReceipt As Boolean
    Private Sub cmdSend_Click()
    ' This is where all of the Components Properties are set / Methods called
    cmdSend.Enabled = False
    lstStatus.Clear
    Screen.MousePointer = vbHourglass
    With poSendMail
    ' Optional properties for sending email, but these should be set first
    ' if you are going to use them
    .SMTPHostValidation = VALIDATE_NONE ' Optional, default = VALIDATE_HOST_DNS
    .EmailAddressValidation = VALIDATE_SYNTAX ' Optional, default = VALIDATE_SYNTAX
    .Delimiter = ";" ' Optional, default = ";" (semicolon)
    ' Basic properties for sending email
    .SMTPHost = txtServer.text ' Required the fist time, optional thereafter
    .From = txtFrom.text ' Required the fist time, optional thereafter
    .FromDisplayName = txtFromName.text ' Optional, saved after first use
    .Recipient = txtTo.text ' Required, separate multiple entries with delimiter character
    .RecipientDisplayName = txtToName.text ' Optional, separate multiple entries with delimiter character
    .CcRecipient = txtCc ' Optional, separate multiple entries with delimiter character
    .CcDisplayName = txtCcName ' Optional, separate multiple entries with delimiter character
    .BccRecipient = txtBcc ' Optional, separate multiple entries with delimiter character
    .ReplyToAddress = txtFrom.text ' Optional, used when different than 'From' address
    .Subject = txtSubject.text ' Optional
    .Message = txtMsg.text ' Optional
    .Attachment = Trim(txtAttach.text) ' Optional, separate multiple entries with delimiter character
    ' Additional Optional properties, use as required by your application / environment
    .AsHTML = bHtml ' Optional, default = FALSE, send mail as html or plain text
    .ContentBase = "" ' Optional, default = Null String, reference base for embedded links
    .EncodeType = MyEncodeType ' Optional, default = MIME_ENCODE
    .Priority = etPriority ' Optional, default = PRIORITY_NORMAL
    .Receipt = bReceipt ' Optional, default = FALSE
    .UseAuthentication = bAuthLogin ' Optional, default = FALSE
    .UsePopAuthentication = bPopLogin ' Optional, default = FALSE
    .UserName = txtUserName ' Optional, default = Null String
    .Password = txtPassword ' Optional, default = Null String, value is NOT saved
    .POP3Host = txtPopServer
    .MaxRecipients = 100 ' Optional, default = 100, recipient count before error is raised
    ' Advanced Properties, change only if you have a good reason to do so.
    ' .ConnectTimeout = 10 ' Optional, default = 10
    ' .ConnectRetry = 5 ' Optional, default = 5
    ' .MessageTimeout = 60 ' Optional, default = 60
    ' .PersistentSettings = True ' Optional, default = TRUE
    ' .SMTPPort = 25 ' Optional, default = 25
    ' OK, all of the properties are set, send the email...
    ' .Connect ' Optional, use when sending bulk mail
    .Send ' Required
    ' .Disconnect ' Optional, use when sending bulk mail
    txtServer.text = .SMTPHost ' Optional, re-populate the Host in case
    ' MX look up was used to find a host End With
    End With
    Screen.MousePointer = vbDefault
    cmdSend.Enabled = True
    End Sub
    ' The following four Subs capture the Events fired by the vbSendMail component
    Private Sub poSendMail_Progress(lPercentCompete As Long)
    ' vbSendMail 'Progress Event'
    lblProgress = lPercentCompete & "% complete"
    End Sub
    Private Sub poSendMail_SendFailed(Explanation As String)
    ' vbSendMail 'SendFailed Event
    MsgBox ("Your attempt to send mail failed for the following reason(s): " & vbCrLf & Explanation)
    lblProgress = ""
    Screen.MousePointer = vbDefault
    cmdSend.Enabled = True
    End Sub
    Private Sub poSendMail_SendSuccesful()
    ' vbSendMail 'SendSuccesful Event'
    MsgBox "Notification Successful!"
    lblProgress = ""
    End Sub
    Private Sub poSendMail_Status(Status As String)
    ' vbSendMail 'Status Event'
    lstStatus.AddItem Status
    lstStatus.ListIndex = lstStatus.ListCount - 1
    lstStatus.ListIndex = -1
    End Sub
    Private Sub Form_Load()
    On Error GoTo ErrHan
    ' Required to activate the vbSendMail component.
    Set poSendMail = New clsSendMail
    With Me
    .Move (Screen.width - .width) / 2, (Screen.height - .height) / 2
    .fraOptions.height = 2475
    .lblProgress = ""
    End With
    cboPriority.AddItem "Normal"
    cboPriority.AddItem "High"
    cboPriority.AddItem "Low"
    cboPriority.ListIndex = 0
    CenterControlsVertical 100, False, txtServer, txtPopServer, txtFromName, txtFrom, txtToName, txtTo, txtCcName, txtCc, txtBcc, txtSubject, txtMsg, txtAttach, lstStatus, lblProgress
    AlignControlsTop False, txtServer, lblServer, cmdSend
    CenterControlsHorizontal 300, False, lblServer, txtServer, cmdSend
    AlignControlsLeft False, lblServer, lblPopServer, lblFromName, lblFrom, lblToName, lblTo, lblCcName, lblCC, lblBcc, lblSubject, lblMsg, lstStatus, lblAttach, lblStatus
    CenterControlRelativeVertical lblServer, txtServer
    CenterControlRelativeVertical lblPopServer, txtPopServer
    CenterControlRelativeVertical cmdSend, txtServer
    CenterControlRelativeVertical lblFromName, txtFromName
    CenterControlRelativeVertical cmdReset, txtPopServer
    CenterControlRelativeVertical lblFrom, txtFrom
    CenterControlRelativeVertical lblToName, txtToName
    CenterControlRelativeVertical CmdExit, txtFrom
    CenterControlRelativeVertical lblTo, txtTo
    CenterControlRelativeVertical lblCcName, txtCcName
    CenterControlRelativeVertical lblCC, txtCc
    CenterControlRelativeVertical lblBcc, txtBcc
    CenterControlRelativeVertical lblSubject, txtSubject
    CenterControlRelativeVertical lblAttach, txtAttach
    CenterControlRelativeVertical cmdBrowse, txtAttach
    AlignControlsTop False, txtMsg, lblMsg
    AlignControlsTop False, lstStatus, lblStatus
    fraOptions.Top = txtTo.Top - 135
    AlignControlsLeft True, txtServer, txtPopServer, txtFromName, txtFrom, txtToName, txtTo, txtCcName, txtCc, txtBcc, txtSubject, txtMsg, lstStatus, txtAttach, lblProgress
    AlignControlsLeft True, cmdSend, cmdReset, CmdExit, cmdBrowse, fraOptions
    lblPopServer.Visible = False
    txtPopServer.Visible = False
    Me.Show
    RetrieveSavedValues
    Exit Sub
    ErrHan:
    If Err.Number = 429 Then
    ' Shell ("regsvr32 /s C:\Utility\Ref\vbSendMail.dll")
    ' Shell ("regsvr32 /s C:\Utility\Ref\MSWINSCK.OCX")
    reg_ = "regsvr32 /s N:\Pic\vbSendMail.dll"
    Shell (reg_)
    reg_ = "regsvr32 /s N:\Pic\\MSWINSCK.OCX"
    Shell (reg_)
    ' reg_ = "regsvr32 /s " & App.Path & "\Ref\vbSendMail.dll"
    ' Shell (reg_)
    ' reg_ = "regsvr32 /s " & App.Path & "\Ref\MSWINSCK.OCX"
    ' Shell (reg_)
    Resume Next
    End If
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    ' Unload the component before quiting.
    Set poSendMail = Nothing
    End Sub
    Private Sub RetrieveSavedValues()
    ' Retrieve saved values by reading the components 'Persistent' properties
    poSendMail.PersistentSettings = True
    txtServer.text = poSendMail.SMTPHost
    txtPopServer.text = poSendMail.POP3Host
    txtFrom.text = poSendMail.From
    txtFromName.text = poSendMail.FromDisplayName
    txtUserName = poSendMail.UserName
    optEncodeType(poSendMail.EncodeType).Value = True
    If poSendMail.UseAuthentication Then ckLogin = vbChecked Else ckLogin = vbUnchecked
    End Sub
    Private Sub optEncodeType_Click(Index As Integer)
    If optEncodeType(0).Value = True Then
    MyEncodeType = MIME_ENCODE
    cboPriority.Enabled = True
    ckHtml.Enabled = True
    ckReceipt.Enabled = True
    ckLogin.Enabled = True
    Else
    MyEncodeType = UU_ENCODE
    ckHtml.Value = vbUnchecked
    ckReceipt.Value = vbUnchecked
    ckLogin.Value = vbUnchecked
    cboPriority.Enabled = False
    ckHtml.Enabled = False
    ckReceipt.Enabled = False
    ckLogin.Enabled = False
    End If
    End Sub
    Private Sub cboPriority_Click()
    Select Case cboPriority.ListIndex
    Case 0: etPriority = NORMAL_PRIORITY
    Case 1: etPriority = HIGH_PRIORITY
    Case 2: etPriority = LOW_PRIORITY
    End Select
    End Sub
    Private Sub cboPriority_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case 38, 40
    Case Else: KeyCode = 0
    End Select
    End Sub
    Private Sub cboPriority_KeyPress(KeyAscii As Integer)
    KeyAscii = 0
    End Sub
    Private Sub ckHtml_Click()
    If ckHtml.Value = vbChecked Then bHtml = True Else bHtml = False
    End Sub
    Private Sub ckLogin_Click()
    If ckLogin.Value = vbChecked Then
    bAuthLogin = True
    fraOptions.height = 3555
    Else
    bAuthLogin = False
    If ckPopLogin.Value = vbUnchecked Then fraOptions.height = 2475
    End If
    End Sub
    Private Sub ckPopLogin_Click()
    If ckPopLogin.Value = vbChecked Then
    bPopLogin = True
    lblPopServer.Visible = True
    txtPopServer.Visible = True
    fraOptions.height = 3555
    Else
    bPopLogin = False
    lblPopServer.Visible = False
    txtPopServer.Visible = False
    If ckLogin.Value = vbUnchecked Then fraOptions.height = 2475
    End If
    End Sub
    Private Sub ckReceipt_Click()
    If ckReceipt.Value = vbChecked Then bReceipt = True Else bReceipt = False
    End Sub
    Private Sub cmdBrowse_Click()
    Dim sFilenames() As String
    Dim i As Integer
    On Local Error GoTo Err_Cancel
    With cmDialog
    .FileName = ""
    .CancelError = True
    .Filter = "All Files (*.*)|*.*|HTML Files (*.htm;*.html;*.shtml)|*.htm;*.html;*.shtml|Images (*.bmp;*.jpg;*.gif)|*.bmp;*.jpg;*.gif"
    .FilterIndex = 1
    .DialogTitle = "Select File Attachment(s)"
    .MaxFileSize = &H7FFF
    .Flags = &H4 Or &H800 Or &H40000 Or &H200 Or &H80000
    .ShowOpen
    ' get the selected name(s)
    sFilenames = Split(.FileName, vbNullChar)
    End With
    If UBound(sFilenames) = 0 Then
    If txtAttach.text = "" Then
    txtAttach.text = sFilenames(0)
    Else
    txtAttach.text = txtAttach.text & ";" & sFilenames(0)
    End If
    ElseIf UBound(sFilenames) > 0 Then
    If Right$(sFilenames(0), 1) <> "\" Then sFilenames(0) = sFilenames(0) & "\"
    For i = 1 To UBound(sFilenames)
    If txtAttach.text = "" Then
    txtAttach.text = sFilenames(0) & sFilenames(i)
    Else
    txtAttach.text = txtAttach.text & ";" & sFilenames(0) & sFilenames(i)
    End If
    Next
    Else
    Exit Sub
    End If
    Err_Cancel:
    End Sub

  • DirectMusic in Visual Studio 2010 on a 64 bit Windows 7

    I Have a Visual Studio 2010 VB programme using DirectX 11 DirectMusic, for playing MIDI audio files which I created on a Windows XP 32 bit machine, I have now moved it to a Windows 7 64 bit machine.  The programme does run OK but the problem I have
    though is it takes at least 2 minutes to load. It loads straight away on the XP 32 bit machine.   In debug stepping through it is the get port information of the output port that is delaying it, code below
    Do
    dwPortCount = dwPortCount + 1
    COutPort.GetPortInfo(dwPortCount, PortInfo)
    Loop While 0 = (PortInfo.dwFlags And DMUS_PC.SOFTWARESYNTH)
    'Debug.WriteLine("Selected output port: {0}", PortInfo.szPortDescription)
    COutPort.SetPortParams(0, 0, 0, [SET].REVERB Or [SET].CHORUS, 44100)
    COutPort.ActivatePort(PortInfo)
    It goes through this loop three times and each time it stops at the line "COutPort.GetPortInfo(dwPortCount, PortInfo)" for quite a while, or the third time after a wait it does continue and loads the form.
    Any Ideas how to sort this problem?
    David

    Hi Dave-OLW,
    As your issue is related to DirectX 11, We have a specilized forum for disscussing the problems about DirectX 11:http://xboxforums.create.msdn.com/forums/76.aspx
    You could post it in the forum for better supports, Thanks.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SharePoint 2010, Visual Studio 2010, Packaging a solution - The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi,
    I have a solution that used to contain one SharePoint 2010 project. The project is named along the following lines:
    <Company>.<Product>.SharePoint - let's call it Project1 for future reference. It contains a number of features which have been named according
    to their purpose, some are reasonably long and the paths fairly deep. As far as I am concerned we are using sensible namespaces and these reflect our company policy of "doing things properly".
    I first encountered the following error message when packaging the aforementioned SharePoint project into a wsp:
    "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."
    I went through a great deal of pain in trying to rename the project, shorten feature names and namespaces etc... until I got it working. I then went about gradually
    renaming everything until eventually I had what I started with, and it all worked. So I was none the wiser...not ideal, but I needed to get on and had tight delivery timelines.
    Recently we wanted to add another SharePoint project so that we could move some of our core functinality out into a separate SharePoint solution - e.g. custom workflow
    error logging. So we created another project in Visual Studio called:
    <Company>.<Product>.SharePoint.<Subsystem> - let's call it Project2 for future reference
    And this is when the error has come back and bitten me! The scenario is now as follows:
    1. project1 packages and deploys successfully with long feature names and deep paths.
    2. project2 does not package and has no features in it at all. The project2 name is 13 characters longer than project1
    I am convinced this is a bug with Visual Studio and/or the Package MSBuild target. Why? Let me explain my findings so far:
    1. By doing the following I can get project2 to package
    In Visual Studio 2010 show all files of project2, delete the obj, bin, pkg, pkgobj folders.
    Clean the solution
    Shut down Visual Studio 2010
    Open Visual Studio 2010
    Rebuild the solution
    Package the project2
    et voila the package is generated!
    This demonstrates that the package error message is in fact inaccurate and that it can create the package, it just needs a little help, since Visual Studio seems to
    no longer be hanging onto something.
    Clearly this is fine for a small time project, but try doing this in an environment where we use Continuous Integration, Unit Testing and automatic deployment of SharePoint
    solutions on a Build Server using automated builds.
    2. I have created another project3 which has a ludicrously long name, this packages fine and also has no features contained within it.
    3. I have looked at the length of the path under the pkg folder for project1 and it is large in comparison to the one that is generated for project2, that is when it
    does successfully package using the method outlined in 1. above. This is strange since project1 packages and project2 does not.
    4. If I attempt to add project2 to my command line build using MSBuild then it fails to package and when I then open up Visual Studio and attempt to package project2
    from the Visual Studio UI then it fails with the path too long error message, until I go through the steps outlined in 1. above to get it to package.
    5. DebugView shows nothing useful during the build and packaging of the project.
    6. The error seems to occur in
    CreateSharePointProjectService target called at line 365 of
    Microsoft.VisualStudio.SharePoint.targetsCurrently I am at a loss to work out why this is happening? My next task is to delete
    project2 completely and recreate it and introduce it into my Visual Studio solution.
    Microsoft, can you confirm whether this is a known issue and whether others have encountered this issue? Is it resolved in a hotfix?
    Anybody else, can you confirm whether you have come up with a solution to this issue? When I mean a solution I mean one that does not mean that I have to rename my namespaces,
    project etc... and is actually workable in a meaningful Visual Studio solution.

    Hi
    Yes, I thought I had fixed this my moving my solution from the usual documents  to
    c:\v2010\projectsOverflow\DetailedProjectTimeline
    This builds ok, but when I come to package I get the lovely error:
    Error 2 The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. C:\VS2010\ProjectsOverflow\DetailedProjectTimeline\VisualDetailedProjectTimelineWebPart\Features\Feature1\Feature1.feature VisualDetailedProjectTimeline
    Now, the error seems to be related to 
    Can anyone suggest what might be causing this. Probably some path in an XML file somewhere. Here is my prime suspect!
    <metaData>
    <type name="VisualDetailedProjectTimelineWebPart.VisualProjectTimelineWebPart.VisualProjectTimeline, $SharePoint.Project.AssemblyFullName$" />
    <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
    </metaData>
    <data>
    <properties>
    <property name="Title" type="string">VisualProjectTimelineWebPart</property>
    <property name="Description" type="string">My Visual WebPart</property>
    </properties>
    </data>
    </webPart>
    </webParts>
    .... Unless I can solve this I will have to remove the project and recreate but with simple paths. Tho I will be none the wiser if I come across this again.
    Daniel

  • I am having trouble in installing Visual Studio 2010 Ultimate on Windows 7 SP1 x64

    Hi
    I am trying to Install VS2010 Ultimate on Windows 7 X64 SP1 Specifically SP1 because before it I am using Windows 7 x64 and VS2010  Ultimate working there excellently. When I try to install it says the Setup file is incompatible with your Windows version
    I am surprised by this please reply me as soon as possible
    Thanks in Advance
    Arpit

    Hi Arpit,
    Welcome to the MSDN Forum.
    As far as I know, Visual Studio 2010 is compatible with Windows 7 SP1. I think this issue might related with the Visual Studio install media. I recommand you download Visual Studio 2010 Ultimate from
    this link, and follow the steps below to install it:
    Before install Visual Studio, please finish the steps below first:
    Turn off your anti-virus/antispyware software during installation;
    Install the latest Windows updates from the Windows Update site:
    http://update.microsoft.com;
    Complete or dismiss Windows Update before installation. (And don't forget to turn it on later);
    Clean your %temp% folder (Start Menu >> Run >> Type "%temp% >> OK);
    Run the setup with Administrator privilege: right-click the installer -> Run as administrator
    If the installation still failed, please collect the installation log files from "%temp%" folder with the
    Log Collection Tool.
    Send the vslogs.cab file in the %temp% folder to me for further analyze(E-mail: v-anwu_at_microsoft_dot_com). Note: Please attach the link of this post in the mail.
    If you have any concerns, please feel free to let me know.
    Best Regards, 
    Andrew Wu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RFC & BAPI  with Visual Studio 2010 (C/ C++)

    Hello,
    I would to develop, into MS Visual Studio 2010 (c/ c+), a application that allows establishing a RFC connection to SAP (ECC6) and call a Z program, or call a BAPI from my c/c+ application.
    Can you recommend a good documentation, possibly with examples?
    If anyone has any sample code, maybe a project in MS VS (c/c++), would be great.
    Sincerely,
    Serena

    Hi,
      Hope the following code will help you.
    For establishing connection:
    public class MyBackendConfig : IDestinationConfiguration
                public RfcConfigParameters GetParameters(String destinationName)
                    if ("SE38".Equals(destinationName))
                        RfcConfigParameters parms = new RfcConfigParameters();
                        parms.Add(RfcConfigParameters.AppServerHost, "192.168.1.14");
                        parms.Add(RfcConfigParameters.SystemNumber, "02");
                        parms.Add(RfcConfigParameters.User, "abaper");
                        parms.Add(RfcConfigParameters.Password, "erpanderp");
                        parms.Add(RfcConfigParameters.Client, "800");
                        parms.Add(RfcConfigParameters.Language, "EN");
                        parms.Add(RfcConfigParameters.PoolSize, "5");
                        parms.Add(RfcConfigParameters.MaxPoolSize, "10");
                        parms.Add(RfcConfigParameters.IdleTimeout, "600");
                        return parms;
                    else return null;
                public bool ChangeEventsSupported()
                    return false;
                public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;
    Getting tables from BAPI:
    private void button1_Click(object sender, EventArgs e)
                checkedListBox1.Items.Clear();
                RfcDestination prd = RfcDestinationManager.GetDestination("SE38");
                RfcRepository repo = prd.Repository;
                IRfcFunction companyBapi1 = repo.CreateFunction("ZBAPI_PACKAGE_OBJECTLIST");
                string package = "EU_" + comboBox1.SelectedItem.ToString();
                companyBapi1.SetValue("PACKNAME", package);
                companyBapi1.Invoke(prd);
                IRfcTable address1 = companyBapi1["TOBJECTS"].GetTable();
                if (address1.RowCount != 0)
                    for (int index = 0; index < address1.RowCount; ++index)
                        checkedListBox1.Items.Add(address1[index]["PROGRAM"].GetString());
                        panel2.Visible = true;
                else
                    MessageBox.Show("No Programs Found");

  • Crystal Reports, version for Visual Studio 2010 Problem

    Dear all,
    I encounter a problem after installed the crystal report version for Visual Studio 2010. Once I call                              
                           ReportDocument.PrintToPrinter(1,False, 0, 0)
    The error message prompt:
    Report is unavailable(Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index)
    If I try
                             ReportDocument.PrintToPrinter(1,False, 1, 1)
    It can print the 1st page of the report.
    I also try to create a simple report. It works.
    After installed this version, my reports also encounter the same problem in Visual Studio 2008.
    My report has sub-reports. My PC is Windows XP.
    Anybody has idea on this issue!?

    Now you can set the various printer options using the PrintOutputController. I'm using a UI box to select the printer but your developer should be able to figure this out. If not you can include him in the e-mail, it would be fine to go direct. Of course you will stay in the thread:
         private void btnSetPrinter_Click(object sender, System.EventArgs e)
              System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument();
                CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions rasPROpts = new CrystalDecisions.ReportAppServer.Controllers.PrintReportOptionsClass();
              // Use the next line if you need to, you'll ahve to test. Depends on how the reports were saved.
                //CrystalDecisions.CrystalReports.Engine.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                //CrystalDecisions.ReportAppServer.ReportDefModel.ISCRPrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                //pDoc.DefaultPageSettings = pgSettings;
                PrintDialog dlg = new PrintDialog();
                dlg.Document = pDoc;
                if (dlg.ShowDialog() == DialogResult.Cancel)
                    MessageBox.Show("Cancel Button clicked", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                else
                    CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions MYPRTOpts = new PrintOptionsClass();
                    if (rdoCurrent.Checked)
                        pDoc.PrinterSettings.PrinterName = cboCurrentPrinters.Text;
                   // the next 3 lines may not be necessary.
                        MYPRTOpts.PrinterName = cboCurrentPrinters.Text;
                        MYPRTOpts.PaperSize = (CrPaperSizeEnum)
                            pDoc.PrinterSettings.PaperSizes[cboCurrentPaperSizes.SelectedIndex].Kind;
                        MYPRTOpts.PaperSource = (CrPaperSourceEnum)
                            pDoc.PrinterSettings.PaperSources[cboCurrentPaperTrays.SelectedIndex].Kind;
                        MYPRTOpts.PaperOrientation = CrPaperOrientationEnum.crPaperOrientationLandscape;
                        //MYPRTOpts.PageMargins.Bottom = .1;
                        //MYPRTOpts.PageMargins.Top = .1;
                        //MYPRTOpts.PageMargins.Left = .1;
                        //MYPRTOpts.PageMargins.Right = .1;
                    else
                        pDoc.PrinterSettings.PrinterName = cboDefaultPrinters.Text;
                        MYPRTOpts.PrinterName = cboDefaultPrinters.Text;
                        MYPRTOpts.PaperSize = (CrPaperSizeEnum)
                            pDoc.PrinterSettings.PaperSizes[cboDefaultPaperSizes.SelectedIndex].Kind;
                        MYPRTOpts.PaperSource = (CrPaperSourceEnum)
                            pDoc.PrinterSettings.PaperSources[cboDefaultPaperTrays.SelectedIndex].Kind;
                    rptClientDoc.PrintOutputController.ModifyPrintOptions(MYPRTOpts);
                    //MessageBox.Show("Printer set.", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    rptClientDoc.PrintOutputController.PrintReport(rasPROpts);
                    //MessageBox.Show("Printing report.", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
    Thank you
    Don

  • Side by side installation Crystal Reports for Visual Studio 2010 - CRXIR2 ?

    we are integrating Crystal Reports for Visual Studio 2010 into our C++ application.
    We used to work with CRXIR2.
    A customer of ours has upgraded to the VS2010 runtime version for 64-bit,
    and seems to be having random crashes.
    We haven't been able to pinpoint the problem...
    They are running several of our applications simultaniously on terminal servers.
    What we noticed is that they did not uninstall CRXIR2 from there system.
    Is this side-by-side installation supported?
    So XIR2 next to Crystal Reports for Visual Studio 2010  ?
    And even: can you have a Crystal Reports for Visual Studio 2010  64bit next to a 32bit? Probably yes?
    Next to that: is there any limit of concurrent users (applications) that use the .NET component?
    I would think not...
    Bart

    Hi Bart,
    Side by side installation shouldn't be a problem, unless you had Beta version of CRVS2010 installed on the same machine.
    For better results try upgrading to use SP1 of CRVS2010. For CRVS2010 resources, you can go through this
    Crystal Reports for Visual Studio 2010 - Deployment
    I haven't seen any problem with 64bit next to a 32bit til date.
    You can go through this for CR support on x64
    http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/10d5fa88-2013-2c10-c9a5-f11963607d4e
    To answer your last question, go through following:
    Crystal Reports Maximum Report Processing Jobs Limit
    http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/f053713e-3e3d-2c10-2a81-f79259e54023
    Thanks,
    Saurabh

  • CRVS2010 Beta - How do you hide the Group Tree for Visual Studio 2010

    Would anyone know how to hide the group tree in the Crystal Reports viewer for Visual Studio 2010.  I have tried
    DisplayGroupTree="False" and found the property doesn't exist in the new version for VS 2010.  I have search in the designer options and found nothing.  Note this report is for ASP.net.
    Thanks
    Dave.
    Subject modified as per the sticky post at the top of this forum; [Crystal Reports for Visual Studio 2010 Beta - read before posting|Crystal Reports for Visual Studio 2010 Beta - read before posting;
    Edited by: Ludek Uher on Sep 15, 2010 8:55 AM

    A simple search using the search box in the top right corner of this web page would have come up with the following KBase as one of the 1st - if not the 1st hit (for once, we beat Google    ).
    [1183704 - How to display or hide the Group Tree in CrystalReportViewer control through code in Crystal Reports 2008|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133383333333733303334%7D.do]
    - Ludek

  • Crystal Report errors when installing visual studio 2010 app

    I'm trying to install a Visual Studio 2010 application on two client's machines and I get a different error on each one.  Both errors point to Crystal Reports.
    I have a feeling that I'm supposed to install something on the client's machines but I'm not sure what.
    The first client's error says that CrystalDecisions.Windows.Form Version 13.0.2000.0 cannot be loaded.
    The second client's error says that FlashControlV71. Version 1.0.3187.32366 needs to be installed in the GAC.
    What am I supposed to install on the client's machines?  Or if that's not the problem, what is causing the errors?
    This is my first visual studio app so I'm a complete newbie.
    Thanks for any help or advice.

    Thanks for your reply.  I installed the runtime (x64) and am now getting a new error on the first client's machine.  I think it's telling me that I installed the wrong version of the runtime.  The client is running x64t Win 7 so I chose the x64 runtime to install. 
    System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to http://www.businessobjects.com/support for more information.
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
       --- End of inner exception stack trace ---
       at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
       at IM_CMETracking.ReportViewer.CrystalReportViewer1_Load(Object sender, EventArgs e)
       at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
       at CrystalDecisions.Windows.Forms.CrystalReportViewer.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    The second client is running XP.  The error I'm getting on their machine is this:
         CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException:    Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
    Thank you for your help.

Maybe you are looking for

  • How to configure evtouch without xorg.conf

    So Im using evtouch for my egalax touchsreen, almost working Axes are screwed up. I cant figure out what file and how Im supposed to edit to get axes right. Heres my Xorg.0.log X.Org X Server 1.6.3 Release Date: 2009-7-31 X Protocol Version 11, Revis

  • PDF's with images open with dark (mask) overlay..not true in Explorer...how to change setting?

    When browsing in Firefox, some links to PDF's that I open, those with images, open with a dark mask overlay. I have have searched around in the VIEW menu with no luck. This does not happen when I open the same PDF links in Windows Explorer so it must

  • Discuss the componet of Oracle "Oracle Spatial "

    Hi,Everyone! I'm studing the spatial index with the oracle spatial,cause the oracle have two index methods: R-tree and Quadtree.The index I have completed! Now,I have some problem whit performance test.I didn't kown how complete the performance test(

  • Over to T - Mobile

    Hello all Im on AT&T now but im going over to T - Mobile what should I look out for? Whats the best pain for the n900 on T - Mobile? Does any one get drop calls with there n900 on T - Mobile? if so is it real bad thank you

  • ESS Upgrade To ECC 6.0 & EP 7.0!

    Hi Gurus, Our current landscape is like the following <b>SAP R/3 4.6C with ESS BP 50.4 and EP 6.0 with WAS 6.40 and Standalone ITS 6.20.</b> Now we are upgrading to <b>ECC 6.0 and EP 7.0 / WAS 7.0 with integrated ITS</b>. As we are having huge modifi