top of page

Vivir sin dolor

Público·8 miembros
Maverick Sanchez
Maverick Sanchez

Create Activex Dll In Visual Studio 2005



Next, we'll reference this COM component from a Windows Forms application. Start Visual Studio 2005, and create a new Visual Basic WindowsApplication project named "RegFreeComDemo1". You can also use C# or J# if you prefer, since the code will be trivial and easily adaptable to the language of choice. Select the Project menu, choose the Add Reference command, and browse to the VB6Hello.dll component produced from the code. Add a button to the form named "Say Hello", double-click on it to go to the code window, and add the following code:




create activex dll in visual studio 2005



Start Visual Studio 2005 and create another new Visual Basic WindowsApplication project named "RegFreeComDemo2". Next you'll add the VB6ControlTest component to your project, but since this is an ActiveX control, you need to add it through the Toolbox. Click on the View menu and select Toolbox. Right-click the General tab and select the Choose Items command. From the Choose Toolbox Items dialog, click the COM tab and browse to VB6ControlTest.ocx. Drag the VB6ControlTest.UserControl1 control to your form and resize it so that the entire tab control is visible. When you've completed all of this, you should have something that looks like Figure 6.


Visual Studio 2005 supports references to native assemblies from Visual Basic .NET or C#. A native reference is created when a reference's File Type property is set to Native in the Properties window. To add a native reference, select Project Add Reference, then click the Browse tab and navigate to the location of the manifest. Some components place the manifest inside the DLL. In this case, you can simply choose the DLL itself and Visual Studio will add it as a native reference if it detects that the component contains an embedded manifest.


You use Microsoft Visual Studio 2005, and you create an ActiveX control in an application. You call the AtlIPersistPropertyBag_Load function from the ATLCOM.h file. When you run the control, an "Access Violation" exception may occur. Additionally, the application crashes.


Hai Elaine Dove,\\n Really appriciate your response. \\nI walkthrough the entire links and download the \\nsample code files but there is no source like my expectation.\\n Actualy now i know the basic operation of crystal report\\n.That is how to use XML / XSD file and how to design the\\n report at design time and how to bind it & display in the \\nreport viewer control. But still i'm not get how to add \\ntable,fieldobject,blobobjects to crystal reports at runtime \\nprogramaticaly. Could you please help me how to solve this \\nproblem?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4669303,\"creationDate\":1219922493000,\"activeRevisionId\":6437829,\"lastActivity\":1219922493000,\"parentId\":4664012,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false}]},\"4632250\":\"rootParentId\":4632250,\"commentsCount\":2,\"comments\":[\"body\":\"Hai as per your advice i add the following code \\n\\npublic void AddDatabase()\\n \\n try\\n \\n //Variables used to setup the Database connection\\n CRAXDRT.DatabaseTables crDBTables;\\n string sDatabasePath;\\n string sTableName;\\n \\n //Get the Tables collection because it has the Add() method needed \\n //to add a connection to the report\\n crDBTables = crReport.Database.Tables;\\n //Set the values for the connection variables\\n //The full path and name of the Access database.\\n //The database resides in the same directory as the application\\n sDatabasePath = Server.MapPath(".") + "xtreme.mdb";\\n //The name of the Access table\\n sTableName = "Customer";\\n //Use the .Add() method to add the database table to the report.\\n //There are several optional arguments for the Add method. Which arguments are passed\\n //will depend on the type of database, the type of table and the type of connection.\\n //Add the 'Customer' table\\n crDBTables.Add(sDatabasePath, null, null, null, null, "D3326", null, "xtreme", "", "");\\n \\n catch (Exception ex)\\n \\n throw ex;\\n \\n \\nbut when the control is reached the Bolded line then it'll throw an error as \\nObject reference not set to an instance of an object.\\nand i trace it, it like this\\nStack trace: at CRAXDRT.ReportClass.get_Database()\\n at DynamicBinding._Default.AddDatabase() in D:\\\\DotNetPracticals2005\\\\CR 11.5\\\\DynamicBinding\\n\\nCould you please tell me how to solve this error?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4636708,\"creationDate\":1219400683000,\"activeRevisionId\":6411776,\"lastActivity\":1219400683000,\"parentId\":4632250,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4672571\":\"rootParentId\":4672571,\"commentsCount\":3,\"comments\":[\"body\":\"Hello,\\n\\nThe references will be different in your application since you are using Crystal Reports XI R2 but the code should be the same. You need to use In-Proc RAS since you do not have Crystal Reports Server or Business Objects Enterprise installed.\\n\\n // Create a RAS Document through In-Proc RAS through the RPTDoc.\\n _ClientDoc = _ReportDoc.ReportClientDocument;\\n\\nThat is exactly what you need to do what you want to do.\\n\\nElaine\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4678233,\"creationDate\":1220029960000,\"activeRevisionId\":6445058,\"lastActivity\":1220029960000,\"parentId\":4677363,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4656778\":\"rootParentId\":4656778,\"commentsCount\":1,\"comments\":[\"body\":\"Hai Elaine Dove,\\n\\n Really thanks for your response. Before start to study Report application server i have one questsion \\nCan we use Report Application Server in Visual Studio2005 and Asp.Net2.0?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4662332,\"creationDate\":1219842113000,\"activeRevisionId\":6432268,\"lastActivity\":1219842113000,\"parentId\":4656778,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4648537\":\"rootParentId\":4648537,\"commentsCount\":1,\"comments\":[\"body\":\"Hai thanks for your response, actualy i want to use ado.net for this dynamic binding purpose, then could you tell me how to use ado.net and cr11.5.?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4649871,\"creationDate\":1219727551000,\"activeRevisionId\":6422224,\"lastActivity\":1219727551000,\"parentId\":4648537,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false]}"); const simplifiedQuestionView = JSON.parse("true"); (function() window.pageContext = mergeDeep(pageContext, question: id: 4631300, plug: "crystal-reports-activex-designer-design-and-runtim", votes: 0, questionTitle: "Crystal Reports ActiveX Designer Design and Runtime Library 11.5", isClosed: false, isLocked: false, isRedirected: false, redirectedFromTitle: "", redirectedFromId: "", closedStatusData: JSON.parse(""), userVoted: false, relations: JSON.parse("\"canClose\":false,\"canUnredirect\":false,\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"canReopen\":false,\"type\":\"question\",\"canVoteUpOrCancel\":false,\"canViewRevisions\":true,\"canUnlock\":false,\"reported\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canCancelReport\":false,\"canComment\":true,\"isCurrentUserAuthor\":false,\"canViewReports\":false"), isQuestionAccepted: false , childToViewInfo: id: "" , comments: JSON.parse("\"4664012\":\"rootParentId\":4664012,\"commentsCount\":2,\"comments\":[\"body\":\"Hai Elaine Dove,\\n Really appriciate your response. \\nI walkthrough the entire links and download the \\nsample code files but there is no source like my expectation.\\n Actualy now i know the basic operation of crystal report\\n.That is how to use XML / XSD file and how to design the\\n report at design time and how to bind it & display in the \\nreport viewer control. But still i'm not get how to add \\ntable,fieldobject,blobobjects to crystal reports at runtime \\nprogramaticaly. Could you please help me how to solve this \\nproblem?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4669303,\"creationDate\":1219922493000,\"activeRevisionId\":6437829,\"lastActivity\":1219922493000,\"parentId\":4664012,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4632250\":\"rootParentId\":4632250,\"commentsCount\":2,\"comments\":[\"body\":\"Hai as per your advice i add the following code \\n\\npublic void AddDatabase()\\n \\n try\\n \\n //Variables used to setup the Database connection\\n CRAXDRT.DatabaseTables crDBTables;\\n string sDatabasePath;\\n string sTableName;\\n \\n //Get the Tables collection because it has the Add() method needed \\n //to add a connection to the report\\n crDBTables = crReport.Database.Tables;\\n //Set the values for the connection variables\\n //The full path and name of the Access database.\\n //The database resides in the same directory as the application\\n sDatabasePath = Server.MapPath(".") + "xtreme.mdb";\\n //The name of the Access table\\n sTableName = "Customer";\\n //Use the .Add() method to add the database table to the report.\\n //There are several optional arguments for the Add method. Which arguments are passed\\n //will depend on the type of database, the type of table and the type of connection.\\n //Add the 'Customer' table\\n crDBTables.Add(sDatabasePath, null, null, null, null, "D3326", null, "xtreme", "", "");\\n \\n catch (Exception ex)\\n \\n throw ex;\\n \\n \\nbut when the control is reached the Bolded line then it'll throw an error as \\nObject reference not set to an instance of an object.\\nand i trace it, it like this\\nStack trace: at CRAXDRT.ReportClass.get_Database()\\n at DynamicBinding._Default.AddDatabase() in D:\\\\DotNetPracticals2005\\\\CR 11.5\\\\DynamicBinding\\n\\nCould you please tell me how to solve this error?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4636708,\"creationDate\":1219400683000,\"activeRevisionId\":6411776,\"lastActivity\":1219400683000,\"parentId\":4632250,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4672571\":\"rootParentId\":4672571,\"commentsCount\":3,\"comments\":[\"body\":\"Hello,\\n\\nThe references will be different in your application since you are using Crystal Reports XI R2 but the code should be the same. You need to use In-Proc RAS since you do not have Crystal Reports Server or Business Objects Enterprise installed.\\n\\n // Create a RAS Document through In-Proc RAS through the RPTDoc.\\n _ClientDoc = _ReportDoc.ReportClientDocument;\\n\\nThat is exactly what you need to do what you want to do.\\n\\nElaine\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4678233,\"creationDate\":1220029960000,\"activeRevisionId\":6445058,\"lastActivity\":1220029960000,\"parentId\":4677363,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4656778\":\"rootParentId\":4656778,\"commentsCount\":1,\"comments\":[\"body\":\"Hai Elaine Dove,\\n\\n Really thanks for your response. Before start to study Report application server i have one questsion \\nCan we use Report Application Server in Visual Studio2005 and Asp.Net2.0?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4662332,\"creationDate\":1219842113000,\"activeRevisionId\":6432268,\"lastActivity\":1219842113000,\"parentId\":4656778,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false],\"4648537\":\"rootParentId\":4648537,\"commentsCount\":1,\"comments\":[\"body\":\"Hai thanks for your response, actualy i want to use ado.net for this dynamic binding purpose, then could you tell me how to use ado.net and cr11.5.?\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4649871,\"creationDate\":1219727551000,\"activeRevisionId\":6422224,\"lastActivity\":1219727551000,\"parentId\":4648537,\"originalParentId\":4631300,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"moderatorComment\":false,\"liked\":false]"), answerPager: answersCount: 5, page: 1, pageSize: 10, pageCount: 1, sort: "votes" , answers: JSON.parse("[\"body\":\"Hello, \\n \\nCrystal Reports ActiveX Designer Design and Runtime Library 11.5 is the ReportCreation API for Visual Basic 6.0. It is not supported in Visual Studio .NET. There are some older How To articles that are still valid. S


Acerca de

¡Te damos la bienvenida al grupo! Puedes conectarte con otro...

Miembros

bottom of page