|
Yes it's possible - I mix native and managed C++ and use DirectShow and other
Windows Media SDKs.
Your build environment MUST be configured properly!
|
|
|
|
|
Please tell me how to configure it
|
|
|
|
|
1) First you need to change your project settings to use /clr WITHOUT the :pure or :safe.
Right click the project in solution explorer, choose properties -
General/Common Language Runtime Support
If your assembly MUST be pure, then you'll need to use interop or the managed wrappers
for DirectShow, and none of the following applies.
2) Try starting with a stdafx file with the following:
#pragma once
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.
#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0.
#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE.
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <dshow.h>
Set the version macros to target the operating system version you want to target.
3) Make sure you've set your VC++ directories to use the PSDK 2003 R2 files BEFORE using
the VS Windows SDK files, as we discussed already.
4) Make sure you include the following library in your project: Strmiids.lib
|
|
|
|
|
Dearest Mark,
Thank you for your valuable guidance. The code is working now and I have to migrate my code from MFC to windows forms. Thank you so much and very kind of you.
Thanks and Kind regards.
|
|
|
|
|
I have a wsdl generated by axis2. My project is developed in VC++ using Visual Studio2008. Now, when I add a web reference to the project I get a lot of syntax errors and schema warnings.
Following is a snippet of the generated error
1>------ Build started: Project: TrumpotConsole, Configuration: Debug Win32 ------
1>Creating web service proxy file for HermesCoreService ...
1>Schema validation warning: Schema item 'element' named 'getContactResponse' from namespace 'http://quickstart.samples/xsd' is invalid. Namespace 'http://pojo.webservice.hermes.com/xsd' is not available to be referenced in this schema.
1>Schema validation warning: Schema item 'element' named 'getNotificationResponse' from namespace 'http://quickstart.samples/xsd' is invalid. Namespace 'http://pojo.webservice.hermes.com/xsd' is not available to be referenced in this schema.
1>Writing file 'HermesCoreService.h'.
1>HermesCoreService.h
1>HermesCoreService.h(49) : error C2059: syntax error : 'public'
1>HermesCoreService.h(49) : error C2027: use of undefined type 'HermesCoreService::HermesCoreService'
1> HermesCoreService.h(22) : see declaration of 'HermesCoreService::HermesCoreService'
1>HermesCoreService.h(53) : error C2059: syntax error : 'public'
1>HermesCoreService.h(53) : error C2027: use of undefined type 'HermesCoreService::HermesCoreService'
1> HermesCoreService.h(22) : see declaration of 'HermesCoreService::HermesCoreService'
1>HermesCoreService.h(151) : error C2146: syntax error : missing ';' before identifier 'getUpdatesCompletedEventHandler'
1>HermesCoreService.h(151) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>HermesCoreService.h(151) : error C2143: syntax error : missing ';' before '^'
1>HermesCoreService.h(151) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>HermesCoreService.h(151) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
The first few lines of the HemesCoreservice.h are as follows
#pragma once
#using <mscorlib.dll>
#using <system.dll>
#using <system.xml.dll>
#using <system.web.services.dll>
#using <system.enterpriseservices.dll>
using namespace System::Security::Permissions;
[assembly:SecurityPermissionAttribute(SecurityAction::RequestMinimum, SkipVerification=false)];
//
// This source code was auto-generated by wsdl, Version=2.0.50727.1432.
//
namespace HermesCoreService {
using namespace System::Diagnostics;
using namespace System::Web::Services;
using namespace System::ComponentModel;
using namespace System::Web::Services::Protocols;
using namespace System;
using namespace System::Xml::Serialization;
using namespace System;
ref class HermesCoreService; // this is line no 22
ref class Updates;
and the HemesCorService.wsdl
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1="http://quickstart.samples/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http://pojo.webservice.hermes.com/xsd" targetnamespace="http://quickstart.samples/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation>HermesCoreService</wsdl:documentation>
<wsdl:types>
<xs:schema xmlns:ax21="http://pojo.webservice.hermes.com/xsd" attributeformdefault="qualified" elementformdefault="qualified" targetnamespace="http://pojo.webservice.hermes.com/xsd">
<xs:complextype name="Contact">
<xs:sequence>
<xs:element minoccurs="0" name="contactGroup" nillable="true" type="xs:string" />
<xs:element minoccurs="0" name="firstName" nillable="true" type="xs:string" />
<xs:element minoccurs="0" name="gender" type="xs:int" />
<xs:element minoccurs="0" name="lastIp" nillable="true" type="xs:string" />
<xs:element minoccurs="0" name="lastName" nillable="true" type="xs:string" />
<xs:element minoccurs="0" name="status" type="xs:int" />
<xs:element minoccurs="0" name="userAvatarLink" nillable="true" type="xs:string" />
<xs:element minoccurs="0" name="userId" type="xs:int" />
<xs:element minoccurs="0" name="userNick" nillable="true" type="xs:string" />
<xs:element minoccurs="0" name="userSessionId" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complextype> </xs:schema></wsdl:types></wsdl:definitions></system.enterpriseservices.dll></system.web.services.dll></system.xml.dll></system.dll></mscorlib.dll>
modified on Monday, June 23, 2008 10:16 PM
|
|
|
|
|
Look at your post. You need to check the box for ignoring HTML tags otherwise the '<' and '>' don't post.
led mike
|
|
|
|
|
Hello guys,
does anyone here have experience with Dark GDK?
I'm just trying it out but I have a lot of problems with it.
Thanks for your help.
|
|
|
|
|
Dark GDK does not appear to use the .NET Platform so what does it have to do with managed or mixed-mode C++?
Austrian_Programmer wrote: does anyone here have experience with Dark GDK?
I do not, never heard of it until I read your post.
Austrian_Programmer wrote: I'm just trying it out but I have a lot of problems with it.
Does your system meet the minimum requirements for using it?
led mike
|
|
|
|
|
Well, it needs this managed stuff as far as I know.
Yes, my system meets the minimum requirements.
|
|
|
|
|
Austrian_Programmer wrote: Well, it needs this managed stuff as far as I know.
Really? Post the link to their web page that says it requires the .NET platform.
Austrian_Programmer wrote: I'm just trying it out but I have a lot of problems with it.
What kind of problems? Does this sample compile and run?[^]
led mike
|
|
|
|
|
Hai
I am using richtextbox. I want to select some specific word, for that i used richtextbox select command. But i couldn,t select the word can you tell me what i was written is correct or wrong.
String ^ searchString = this->functionBox->Text;
String^ srcText = this->srcTextBox->Text;
bool function = srcText->Contains(searchString);
if(function)
{
int lengthofsearchString = searchString->Length;
int index = srcTextBox->Find(searchString, 0, RichTextBoxFinds::MatchCase);
if(index >= 0)
{
index = srcTextBox->Find(searchString, index + lengthofsearchString, RichTextBoxFinds::MatchCase);
if(index>=0)
{
srcTextBox->Select(index,lengthofsearchString);
//srcTextBox->SelectionColor = Color::Red;
}
}
}
can you tell me
Thanks.
|
|
|
|
|
Your code works fine for me.
Mark
|
|
|
|
|
Hey, gang. I've run into a little problem that I'm hoping someone has tackled before. I'm also hoping this behavior isn't by design! I haven't been able to turn up any relevant information through Google.
When I place a DataGridView in a GroupBox, the font size and color that I am using for that GB's title text overrides that specified in the DGV's various cell/header/row font properties. Even when I change the DGV's font back to my desired settings in the designer, it still takes on those of the GB at runtime, and I get a rather unpleasant looking table.
Is there any way to prevent this behavior? Can anybody tell me why this only seems to happen with the DGV? Thanks for any help you can give me. I appreciate the assistance.
--
PS - I really hope this doesn't violate the spirit of the no cross posts rule. I asked this in the .Net Framework board quite awhile ago, but had no takers. That board doesn't seem nearly as active as this one, and I am using C++/CLI for this project, at least. .... Please don't hurt me, Mike.
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I have a Paint() function in my Form1 that has code to paint the screen in a block nested in an if statement.
System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e)
{
if(myObject)
{
code to display screen
}
}
This works fine when the constructor for myObject is called and an OpenFileDialog is used to read a file that can finish building the object. Since the Paint() function is called continuously, the code to display the screen is not executed when myObject is undefined, but when myObject is finished being instantiated then the display code executes. My problem is when I select "Cancel" in the OpenFileDialog I can stop building the myObject but the constructor completes (thus becoming NOT undefined) and the code to display the screen executes and tries to paint a bunch of undefined stuff and bombs the app. I've tried using a variable myObject->bValid in the above if statement but then the app bombs because the object reference was not set to an instance of an object. Is there a way to suspend the Paint() function so that I can do all of my preliminary stuff and then say "okay, start painting."?
Thanks
Buck
|
|
|
|
|
No. You need to write code in onpaint that handles every possible case ( such as using a 'ready to paint' flag )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Buck,
I would suggest you give your myObject a property Paintable or Valid, and set that
appropriately in the constructor, and check it in your OnPaint.
|
|
|
|
|
Thanks, I must b have a flaw in my flow. I tried using a flag to no avail. I will try again.
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I have a data entry Form that has 50 TextBox controls. The Forms Designer gives these controls the names textBox1, textBox2,.....textBox50. When I check to make sure none of the fields are null I have to write code for each of the 50 controls. It would be nice if I could loop through textBox(n) controls. Is there any way to do this?
Thanks
Buck
|
|
|
|
|
I don't do any forms coding, but can you iterate through the control collection
for the form and look for TextBox controls? Something like:
for each (Control control in form->Controls)
{
if (nullptr != dynamic_cast<textbox>(control))
{
...
}
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
modified on Tuesday, June 17, 2008 6:25 PM
|
|
|
|
|
LMAO did you see my post got voted a '1'? This place is really starting to suck dude.
led mike
|
|
|
|
|
Yeah
I try to ignore all the voting stuff, but I do notice stupid stuff like that.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
F*** um, I'm going to start voting all the idiot questions a '1', I'm on a mission.
led mike
|
|
|
|
|
Well you've got your work cut out for you
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
BuckBrown wrote: I have a data entry Form that has 50 TextBox controls.
BuckBrown wrote: It would be nice if I could loop through textBox(n) controls.
Ok, but wouldn't it be better if you didn't have 50 textbox controls that you had to loop through? Alternative User Interface designs could eliminate that and simultaneously offer a better experience for the user.
led mike
|
|
|
|
|
Hello,
I am trying to learn C++/CLI from a text. I have downloaded source code
from the books website. I then created an empty project (CLR Console App.).
Now I want to add some example source code from the book:
File 1. HelloWorld.cpp
//OK, This I was able to add as a source file to the project.
File 2. HelloWorld.obj
//How do I add this?
//Do I need to add this?
File 3.HelloWorld.exe.manifest
//How do I add this?
//Do I need to add this?
File 4. HelloWorld.exe
//How do I add this?
//Do I need to add this? shouldn't the .exe be created at runtime?
I would really appreciate some input about File 2, 3, 4 with the followig caveat-- If you want to respond w/ "read the MSDN documentation" or "is this a joke question?" (which I have received in the past) don't bother to respond.
I am programming as a hobby an dam grateful for any help...
thanks a lot
|
|
|
|