achim13
Goto Top

Eine Excel Tabelle mit Visual C plus plus express 2010 öffnen

Hallo ich versuche mit Visual c++ express 2010 eine Excel – Tabelle zu öffnen, habe eine Funktion gefunden und eingesetzt, aber leider ohne Erfolg. Kann mir jemand helfen, bin sehr dankbar für jeder Hilfe.
Unten habe ich Queltext eingefügt.
M.f.G Joachim

Test_3.cpp: Hauptprojektdatei.
#include "stdafx.h"
#include "Form1.h"
#include <iostream>
#include <fstream>
#include <string>
#include <Windows.h>
#include "resource.h"
using namespace std;

using namespace Test_3;

void ShellExecute();

[STAThreadAttribute]

HINSTANCE ShellExecute( HWND hwnd,
char *lpOperation,
char *lpFile,
char *lpParameters,
char *lpDirectory,
int nShowCmd );


int main(array<System::String ^> ^args)
{
Aktivieren visueller Effekte von Windows XP, bevor Steuerelemente erstellt werden
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);

Hauptfenster erstellen und ausführen
Application::Run(gcnew Form1());
return 0;
}


Das ist Form1.h


#pragma once

namespace Test_3 {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

/ <summary>
/ Zusammenfassung für Form1
/ </summary>
void ShellExecute();

public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();

TODO: Konstruktorcode hier hinzufügen.

}

protected:
/ <summary>
/ Verwendete Ressourcen bereinigen.
/ </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
protected:

private:
/ <summary>
/ Erforderliche Designervariable.
/ </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/ <summary>
/ Erforderliche Methode für die Designerunterstützung.
/ Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/ </summary>
void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();

button1

this->button1->Location = System::Drawing::Point(118, 101);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"Start\r\n";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);

Form1

this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 264);
this->Controls->Add(this->button1);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);

}
#pragma endregion
#pragma connect (lib, "user32.lib")
#pragma connect (lib, "shell32.lib")

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
ShellExecute(
Handle,
("open"), //("C:\\Windows\\Programme\\Microsoft Office\\OFFICE11\\EXCEL.exe"),
("C:\\WSB_Diplomarbeit\\Visual_C++\\Test_2\\di-do100.xls"),
0, 0 ,SW_SHOWNORMAL);


}
};
}


Ich bekomme solche Fehlermeldung:

Fehler 1 error C2065: 'SW_SHOWNORMAL': nichtdeklarierter Bezeichner c:\wsb_diplomarbeit\visual_c++\test_3\test_3\Form1.h 88


M.f.G Joachim

Content-Key: 150206

Url: https://administrator.de/contentid/150206

Ausgedruckt am: 19.03.2024 um 05:03 Uhr