.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Type Unrecognized in 2nd Form

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :Windows Application

I have an application "1stWindow", with two Forms (Form1 & Form2).  I have just created Form2, and have declared the following:

private: SC_HANDLE MyServiceHandle;

However, this fails compilation, with:

error C2146: syntax error : missing ';' before identifier 'MyServiceHandle'

If I transfer exactly the same declaration to either Form1, or above main() in 1stWindow.cpp, the compiler does not generate any errors.

It looks as though the compiler is not recognising the SC_HANDLE type, yet I have exactly the same 'using namespace' scope statements in both Form1 and Form2, and if I copy the same #include files from the top of 1stWindow.cpp to Form2, the compiler records a number of duplicate declarations, which suggests that, as expected, Form2 is picking up the includes in 1stWindow.cpp, because Form2.h is included in 1stWindow.cpp below the point where these are stated.

What, then, is missing in Form2.h, which prevents me from declaring something of SC_HANDLE type, just as I can in Form1.h?




View Complete Post

More Related Resource Links

Inserting a custom list form for a custom content type

Hello, When I try to insert a custom list form for a custom content type I created, nothing happens. Same thing is for the content type "message" & "discussion". I already cleaned up my profile (http://blogs.msdn.com/b/spdsupport/archive/2008/07/03/how-to-fix-custom-list-forms-will-not-insert-or-show-up-on-the-design-surface-of-sharepoint-designer.aspx) I use MOSS 2007 version and SP designer 2007 SP2 on Win7. Below you can see an example of the custom content type.     Columns Name Type Status Source Title Single line of text Required Item Segment Lookup Optional   Form Lookup Optional   Main Product Lookup Optional   Weight Number Optional   Price/Kg Currency Optional   Unit Price Currency Optional   Manufacturer Lookup Optional   Packaging Lookup Optional   PL Yes/No Optional   Label Lookup Optional   USP Lookup Optional   POSC Lookup Required   Place Lookup Hidden StoreCheckHeader Country Lookup Hidden StoreCheckHeader SC_Link Single line of text Hidden StoreCheckHeader

Form opening in infopath client despite Content Type settings "Display as a Web Page"

Hi all,   I have a strange behavior with my forms. The infopath template is defined as Content Type for my Form library, in the advanced settings I have checked "Display as a Web page" for the "Opening browser-enabled documents" setting. Despite that when the client is availble on the computer which is browsing the Form Library, I'm asked to "Open", "Save" or "Cancel" instead of opening the form in the browser.   Any idea why this is happening ?

Is there any way to populate an InfoPath form field with the data from the site content type column?


I have a Form library with a form template.

The templat has a field "Office name" which should not be a fixed list of values, but a dynamical list, feeded from a different type of form. I'm a novice with InfoPath - Sharepoint and I want to find out, how can I can give users a possibility to create and maintain a list of offices and also have this list as a selection list inside main library form - ALL inside one library, if possible.

I assumed that if I publish main form (Itinerary) as a library template form and lookup form (OfficeInfo) as a SiteContent, I should be able somehow to connect to siteContent column and it's information. But I cannot see how - Site Content Gallery is not appering as a Connection item.

Can I use SiteConenct for this purpose or there are other ways to create end-user lookup lists?

Thank you!


Edit form List for External content type



I've made a list based on an extenal content type and create an InfoPath form just for viewing details on list items (read only)

My problem is that  the page(displayifs.aspx) displaying this form doesn't have a title (it's blank) and I don't know how to change it.



Sorin Sandu

publish infopath form to sharepoint services 3.0 as content type



can an infopath form be published as content type to a sharepoint services 3.0 form library?

i have created 2 form libraries. one to store the tamplate an the other to store the form itself and where you can open a new form.

but whenever i click new to open a new form i get this error message:

the element "comment" is used but not declared in the DTD/schema.

does any one know what this error could be?

cannot register custom edit form through a content type and deploy it as a feature


custom edit form through a content type and deploy it as a feature.. the RTM version of sharepoint 2010 does not register the custom forms. the elements.xml is pretty straight forward..

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <!-- Parent ContentType: Workflow Task (0x010801) -->
 <ContentType ID="0x010801007fc29cb23c2049c3985ccdb95fc8331f" Name="ReviewTask" Group="Content Types" Description="Review workflows task purpose" Inherits="TRUE" Version="0">
   <FieldRef ID="{2C2BE3C6-0EB6-4F53-B612-CF49A7EF4013}" Name="Review Status" />
   <FieldRef ID="{CE1D0566-DDC6-4AA3-80C2-6CEA892F105E}" Name="Review Date" />
   <FieldRef ID="{07CB9AA2-0102-4741-9F9A-AC4A7D62D769}" Name="Review Comments" />
   <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">

InfoPath 2007 Form Content Type does not save as infopath form but as xml document.


I have a couple of infopath forms deployed to sharepoint as content types. Normally, when a user creates a new document of an infopath content type, the form opens in browser mode and ,when the user fills in the form and saves the form, a new document is created in the document library with the correct icon and progid.

This was before... Now, whenever I save a form, the form submits correctly, i see the file in de document library, BUT it has the icon of an XML document, all the infopath functionality is gone and when I click the file, I get a save as dialog...

The form itself hasn't changed that much and even when I redeploy a version that worked before it still does not work. However, when I create a new doc lib and associate the malfunctioning form there, the behavior is normal and i can still reopen the saved form.


Little sidenote: I have 7 different forms that now do not work on my test machine. It used to be only one, but after redeploying them, all of them have the same problem. Now when I deployed these forms in a production environement, the same thing started happening there. So I stopped the deployment and in production there is just the newly deployed form that does not work.

I have already tried reassociating the form to the doc lib. And everything looks normal in central administration.

Any suggestions?


How to use the cotent type published form?


Hi all

When I publish our form to SharePoint, I published it to a content type, and then enabled a SharePoint document library to use that form template.

I then created a couple of forms. Later I wanted to update the form template, and was expecting my allready created forms to not update with the new design and new fields (like it does with Excel and Word templates), but it did. All allready created forms also changed.

This can be rather inapropriate if the company wants to change the form template, and keep the old schemas the way they were.

How do you manage that?
Do you allways create new content types when the form needs to be updated?


Cannot Display Application Page as Custom Form for Content Type



I've created a custom content type in VS. In "Elements.xml" file of my content type, I added my custom application page as new form and deployed as feature.

   <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">

How to create a custom content type with own custom view ,add, edit and delete form in sharepoint fo


How to create a custom content type with own custom view ,add, edit and delete form in sharepoint foundation server 2010 using visual studio 2010?

I donot want to use default form "form.aspx".

we can use my custom form in place of "form.aspx"?

Provision an InfoPath form template in a content type, with "view in browser" option

Hi all.
I've to provision an InfoPath form template in SharePoint 2010 within a content type, and my form must be open in a browser.
The provision of the .xsn file and of the content type goes well, but my form always open in the client and not in the browser. Instead, if i publish my form from InfoPath 2010 using the "Publish" option and i select to publish my form within a content type, everything goes well. I can see the form in the browser.

Here is my code.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <Module Name="OpeningJeans" Url="_cts/MY CONTENT TYPE" RootWebOnly="TRUE">
  <File Path="InfopathModules\MyForm.xsn" Url="MyForm.xsn" />


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Form (0x010101) -->
 <ContentType ID="0x0101

http 400 Error when performing item upload after setting custom edit form on content type



What I am trying to do is create custom edit forms for different content types within the same document library.....so basically I have done the following:

  • I have created two site content types and reconfigured my library to use CT's. 
  • I then connected to my site using SPD. 
  • When examining my library I can see that I have the two CT that I added earlier.  I then created a new editform for one the CTs using the top ribbon menu and in the drop down box associated it to the CT.  I did not select this as the default form for the library.
  • I then updated the library CT (not site CT) with the url to form in the editform properties.

When I create a document and edit the properties it works fine - totally as expected.  However when I upload a document the default EditForm for the library is used and I can select the CT to associate the document to.  When I choose the CT with the custom form the new edit form is not found and I get a page not found error - http 400.

The full url for this library is is http://XXXX/functions/ehs/CSI

So the URL I have used is /functions/ehs/CSI/Forms/EditForm2.aspx (EditForm2.aspx) is my form and this is fine.  I have even used CSI/Forms/EditForm2.aspx and this works...  BUT ne

How do I deploy a custom form with a Content Type?

I have a VseWSS solution which deploys a site definition. Within this are some site columns and content types. With one of these custom content types, I'd like to use a customised form for displaying details. I know how to do it manually via SPD (List Properties > Supporting Files > Content Type, etc) but I can't figure out how to include it in my package.

PDF form as Content Type for SharePoint Document Library


Is there any way to use PDF form (.pdf)  template as Content type for document library??

I have a pdf form template and i want to make a content type of it, so i can use it for my Document Library. I defined a new content type of it with following settings:

Select Parent Content From dropdown: Special Content Types,
    Parent Content Type Dropdown: Unknown Document Type

Under Advance Settings i uploaded the pdf form template to server. Under Document Library Settings I add this content type to it, now when i click NEW button it gives me an error message saying:

"The Document couldn't be created. The required application may not be installed properly, or the template for this document library can't be opened"

Seems like SharePoint doesn't integrate with or support Adobe Reader to open PDF form as Content Type or I am missing something there (for example: dll ).

I would really appreciate if you help me on this. Thanks


InfoPath form as a content type for SharePoint List


 Hi All,

I have designed a InfoPath form and published that form as Site Content type and it is stored in to Shared Document library. I want to set this content type into sharepoint list. So when the user selects "New Item" then the InfoPath form should be opened and user can fill the data and it is stored in that list. And also i want to use SharePoint Object Model to break the permission of the InfoPath form.

Can you please help me?




"The webpage cannot be found" when using a custom form for a custom content type



I have a custom content type to which I want to attach a custom form.

I use a module to upload my custom form as following:

<Module Name="ListsContacts_pages" Url="_cts/Andromeda - Individual" RootWebOnly="TRUE">
  <File Url="Contact.aspx" Type="Ghostable"

TreeSelector : playing with generics and type inference

create a generic way to define a selection starting from a tree of objects, the most simpler way as possible.

Let's start with the beginning...
Here is a very simple little interface defining a node of the tree, basically, a value and the references to the child nodes.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend