|
I have created an MFC ActiveX Control through the wizard. In the 2nd Step of the wizard I have enabled the checkbox saying “Available in Insert Object Dialog”, so that I can use my control in Microsoft Office Application like MS Word, Excel, PowerPoint etc using Insert Objects.
I am using property sheet to change the text contents of my control. For that I followed the steps mentioned the MSDN Example CIRC.
http://msdn2.microsoft.com/en-us/library/c6hzbzz6(VS.80).aspx
My control features the following characteristics.
• Changing the painting behavior of an ActiveX control
• Adding stock properties
• Adding custom properties
• Responding to mouse events
• Adding custom events
• Using text and fonts
• Implementing ActiveX control property pages
• Using simple data binding for control properties
But at present I am stuck up problems.
1. Using property sheet I can update the text contents in ActiveX test container. But it doesn’t get updated in Word, and other Office Applications. In fact its not even recognizing any of the event fired by the user (like changing the color on mouse click, key press etc) in any of the office application.
2. I am using this control for assigning digital signatures to a document. For that I am using X509 libraries. But these libraries use Common Language Runtime (/CLR) Support. And if I enable CLR from the project settings, the control crashes while loading on the Office application, ultimately crashing the entire document.
|
|
|
|
|
I don't see anywhere that you say you're using C++/CLI ? Try asking in the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using C++/CLI 2005. I have a 'for each' loop to access each element in an array. I would like to access the array index number within the loop but there doesn't appear to be any function that will return the index value. Can this be done?
Buck
|
|
|
|
|
No, you have to keep track of it yourself.
array<String^>^ names = {L"George", L"John", L"James"};
int index = 0;
for each (String^ name in names)
{
Console::WriteLine(L"{0}[{1}]", name, index++);
}
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
foreach is just syntactic sugar, it just generates a for loop. Use a for loop if you need the index.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: syntactic sugar
That's a good name for a band!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am using C++ 2005. I placed a listView control on a tab page and defined three columns using the property page of the listView control. When the Columns property is selected the 'ColumnHeader Selection Editor' dialog box comes up and under the Misc section of the ColumnHeader properties is a TextAlign property. If I select 'Center' for columnHeader2 and columnHeader3, the headers center justify as you would expect them to. But when I select 'Center' for columnHeader1 the property remains 'Left' justified, I can't seem to change it. Is this a little MS bug? Does this behavior occur for anyone else out there?
Buck
|
|
|
|
|
Are you using "Managed" containers for this? This is the "Managed" C++ forum. If you are not using "Managed" code in your solution you didn't manage to post in the correct forum. If you are using the Standard Template Library (STL) there is a forum dedicated to ATL / WTL / STL[^]
led mike
|
|
|
|
|
sorry in advanced if i posted in wrong forum
I am looking for help how to output a chart into the arrays, all i was given was that i need to put a loop inside of a loop. The chart given is:
0 0 0 0
0 1 2 3
0 2 4 6
0 3 6 9
This is what I have so far:
#include "stdafx.h"<br />
#include "pattern.h"<br />
#include <vector> <br />
#include <fstream><br />
#include <iostream><br />
#include <iomanip><br />
#include <string><br />
<br />
using namespace std;<br />
CWinApp TheApp;<br />
<br />
<br />
<br />
int main()<br />
{<br />
int j;<br />
int i;<br />
int test_score[4][4];<br />
<br />
for(i = 0; i < 4; i++)<br />
{<br />
for(j= 0; j < 4; j++)<br />
{<br />
test_score[i][j] = 0;<br />
cout<< test_score[i][j];<br />
}<br />
<br />
cout<<endl;<br />
}<br />
<br />
<br />
return 0;<br />
}
-- modified at 9:17 Wednesday 18th April, 2007
|
|
|
|
|
Hello
re : nested loops
Your loop should look like this:
for(int i = 0 ; i< 4; i++)
{
for(int j = 0 ; j< 4; j++)
{cout << j*i << " " ;
}
cout<< endl;
}
multiplying the outer loop i with the inner j
seems to get the result;
hope this might help
Phill
|
|
|
|
|
Sorry for such a simple question im sure, but how does a person make sure data types are correct for creating an easy robust program.
code : cout << "Enter number of terms" << endl;<br />
cin >> terms;
I want to make sure terms is an Interger type, can i do that with an if statment?
if (terms = ?(some function call))
or is there another way to code to make sure what is entered is an Integer and not a character or string value?
If at first you don't succeed .... DENY EVERYTHING!
|
|
|
|
|
This is standard C++. You're in the C++/CLI forum, try the visual C++ forum.
If terms is an int, I believe it will keep asking until you enter an int value. Or you can accept a std::string and try to parse it yourself and give custom errors. Things like atoi will help here.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
How can i access filesystem within c++?
Can i use standard C functions? Like chdir, etc?
Thx,
Nuno
|
|
|
|
|
If you are looking for native code, please ask this in the Visual C++ forum. Else take a look at the classes in the System.IO namespace.
Regards,
Nish
Fly on your way like an eagle
Fly as high as the sun
On your wings like an eagle
Fly and touch the sun
|
|
|
|
|
;PNow i have lots of text files in a folder,i want to combine them into one large file,but the problem is that it is must be order the formation rule.
for instance:(the txt file order)
the first text file list item"1c.txt,2c.txt,.........
the second text file list item"1e.txt,2e.txt,........
now the combine file order must be "1c.txt,1e.txt,2c.txt,2e.txt........."
and so on!
Waiting for ur help!
Thx advance!;P
初学者!Don't try it, just do it!
*Archibald*rever dragon!
|
|
|
|
|
Hi,
I am new to vc++.net (mfc),i need to know how to add data and column headers to the MSDATAGRID VERSION 6.0 dynamically IN vc++.Net(mfc application), Please someone help me.
I have taken an sdi(mfc application) and added a MS DataGtrid, now i need to add column headers and data to the grid.The code i added to write is
m_DataGrid1.put_Row(1);
m_DataGrid1.put_Col(1);
m_DataGrid1.put_Text("Nit");
the error i got is "rowset not available".
Thanks in advance
Engilela
|
|
|
|
|
Hi,
I have used MS HEIRARCHICAl FLEX GRID
//code to add row by row to a grid
m_FlexGrid.put_Cols(0,6); // number of columns(5)
m_FlexGrid.put_ColHeader(0,1); //setting the header
m_FlexGrid.put_ColWidth(1,0,1300); //col width
m_FlexGrid.put_ColWidth(2,0,1000);
m_FlexGrid.put_ColWidth(3,0,1400);
m_FlexGrid.put_ColWidth(4,0,1500);
m_FlexGrid.put_ColWidth(5,0,1200);
m_FlexGrid.put_ColHeaderCaption(0,1,"Employee Name");//adding //captions to the header
m_FlexGrid.put_ColHeaderCaption(0,2,"Employee ID");
m_FlexGrid.put_ColHeaderCaption(0,3,"Employee Salary");
m_FlexGrid.put_ColHeaderCaption(0,4,"Employee Address");
m_FlexGrid.put_ColHeaderCaption(0,5,"Employee Age");
m_pSet->MoveFirst();
int RowCount=0;
while (!m_pSet->IsEOF())
{
RowCount++;
m_pSet->MoveNext();
}
m_FlexGrid.put_Rows(RowCount+1);
m_pSet->MoveFirst();
int Row=1;
int Col=1;
while (!m_pSet->IsEOF())
{
m_FlexGrid.put_Row(Row);
m_FlexGrid.put_Col(Col++);
m_FlexGrid.put_Text(m_pSet->m_EmpName);
m_FlexGrid.put_Col(Col++);
long var=m_pSet->m_EmpID;
CString str;
str.Format("%d", var);//to convert long to string
m_FlexGrid.put_Text((LPCTSTR) str);
m_FlexGrid.put_Col(Col++);
double var1;
var1=m_pSet->m_EmpSalary;
str.Format("%0.2f",var1);
m_FlexGrid.put_Text((LPCTSTR) str);
m_FlexGrid.put_Col(Col++);
m_FlexGrid.put_Text(m_pSet->m_EmpAddress);
m_FlexGrid.put_Col(Col++);
var=m_pSet->m_EmpAge;
str.Format("%d",var);
m_FlexGrid.put_Text((LPCTSTR)str );
Row++;
Col=1;
m_pSet->MoveNext();
}
I am sending this so that, it may be useful to someone
Engilela
|
|
|
|
|
Salam,
hi friends i am having a big ptoblem in my project hope i iwll get help here..
lets discuss it
PROBLEM
I want to connect a mobile with my PC such that the sms i recieve is redirect to my PC via connecting cable IR or bluetooth. the main aim is to recieve the message as a varibale in my ptogram i will give example
like i recieved the sms written "hello world"
and the coding use that string and store it in the variable declared such that
char sms= "hello world"
plzzzzzz reply if u know how to store that string as variable
shahensha
|
|
|
|
|
Well, if you're using C++/CLI, you can do String ^ = "hello world". Your overall question makes me think that you're pretty lost, and probably taking on a project that's too hard for your skill level. So, you may also be confused about what this forum is for. It's for .NET C++, not C++ in general. The visual C++ forum is for that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Sushant,
We are here to help you solve a specific programming program not to help you write the whole application or, worst yet, write the whole application. If you need some ideas, please search the web with Google with the key words such as "8-puzzle game programming AI".
Geo
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
You should do your own homework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hello
I looking for a script that can index a folder.
I'm working with borland C++ 6.0.
Great,
Marc
1 day, 24 hours, 1440 minutes, 86400 seconden and then start the next day.
|
|
|
|
|
marc1990 wrote: I'm working with borland C++ 6.0.
So, you posted your question on a Visual Studio site, on a Managed C++ message board...
Great,
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I'm sorry.
Could you recommend a other forum??
Great,
Marc
|
|
|
|