|
|
Amazingly enough its the same in C++ you use shell execute. I am not familar with the pascal langauge but I am guessing the shell execute is a bit more extended then pascal. Yet don't quote me on that anyways this is how you do it.
Code:
HINSTANCE ShellExecute( HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
or for exe file execution
ShellExecute(NULL,"open","myfile.exe",SW_SHOW);
any other questions feel free to ask at my aim name vethax0r
- LiquidKnight
|
|
|
|
|
Thanks at all.
el hombre es libre cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
I've got a document with a CMyClass object, then in the CMDIView I'v got a pointer to that object (CMyClass* m_pMyClass).
When I modify something of that object (i.e. m_pMyClass->SetX() ) I've want it to update the active frame only, since I don't want that modify been shown by other MDI frame windows opened.
If I use Invalidate(), all the windows will be updated.
If I use UpdateAllViews(this), all but the active MDI frame will be update.
I need extacly the opposite of this last case.
Thanks!
|
|
|
|
|
You can pass a 'hint' with UpdateAllViews(). Try using that and say just 'this' view. Or iterate the list of views attached to the doc and do just the one you want.
As an aside I wouldn't have a ptr to CMyClass in the View. You can always get at it via GetDocument.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Can you explain me better the "hint" with UpdateAllViews()?
As for the CMyClass*, I've set it just to have a simpler variable, instead of using everytime GetDocument()->GetMyClass()->(...).
|
|
|
|
|
djordj wrote:
"hint" with UpdateAllViews()?
There are (at least) two possibilities:
The first uses a number, cast into a LPARAM , in the second parameter of UpdateAllViews() .
Depending on that number, your views OnUpdate() can act differently.
The second sends an pointer to a class derived from CObject .
So you could for example build a hierarchy of CObject derieved hint-objects, some of which hold neccessary parameters, and you differentiate them using RTTI.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
The source files don't have to be in the project folder. Just add them to the project normally (Project->Add to Project->Files...) and they should work fine.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hi,
I'm trying to read in a file of the type:
Col1 Col2 Col3 Col4 Col5 Col6
.01 6438. 41.74 8753. 1.3596159.07
.20 6257. 42.05 8811. 1.4082155.84
.40 6159. 42.98 8987. 1.4590146.71
.60 6156. 44.57 9283. 1.5081133.16
.80 6242. 46.84 9707. 1.5551117.11
1.00 6415. 49.87 10265. 1.6002100.41
It is a text file and I want to store each of the columns in an array.
The file is not tab delimited. The columns are separated by spaces.
However col5 is accurate to 4 decimal places and joins col6 with the first number read as 159.07.
How can I sort the data into arrays?
Thanks
kash
|
|
|
|
|
It is really quite simple.
Use the Find() fn in CString to look for the spaces and extract the data between spaces for col 1 thru 4 using the CString::Mid(..) fn Then use the Find() to look for the decimal point after the 4th space and count over 4 positions from there to determine the end of the 5th column and the start of the 6th column. Keep extracting data as needed. Repeat until the file is complete.
Art
|
|
|
|
|
could you provide a code snippet to get me started?
|
|
|
|
|
CString sAllData(".01 6438. 41.74 8753. 1.3596159.07 ");
CString sCol_1[10];
CString sCol_2[10];
CString sCol_3[10];
CString sCol_4[10];
CString sCol_5[10];
CString sCol_6[10];
int iPos1= 0;
int iPos2= 0;
for(int i=0; i<10; i++)
{
iPos2 = sAllData.Find(" ",iPos1);
if(iPos2<0)break;
sCol_1[i] = sAllData.Mid(iPos1, iPos2 - 0); //.01
iPos1 = sAllData.Find(" ",iPos2+1);
if(iPos1<0)break;
sCol_2[i] = sAllData.Mid(iPos2+1, iPos1 - iPos2); //6438.
iPos2 = sAllData.Find(" ",iPos1+1);
if(iPos2<0)break;
sCol_3[i] = sAllData.Mid(iPos1+1, iPos2 - iPos1); //41.74
iPos1 = sAllData.Find(" ",iPos2+1);
if(iPos1<0)break;
sCol_4[i] = sAllData.Mid(iPos2+1, iPos1 - iPos2); //8753.1
iPos2 = sAllData.Find(".",iPos1+1);
if(iPos2<0)break;
int iPosCol5End = iPos2 + 4;
sCol_5[i] = sAllData.Mid(iPos1+1, iPosCol5End - iPos1); //1.3596
iPos1 = sAllData.Find(" ",iPosCol5End+1);
if(iPos1<0) break;
sCol_6[i] = sAllData.Mid(iPosCol5End+1, iPos1-iPosCol5End); //159.07
CString sRow;
sRow.Format("Row[%d] data:\n%s\n%s\n%s\n%s\n%s\n%s",i
,sCol_1[i]
,sCol_2[i]
,sCol_3[i]
,sCol_4[i]
,sCol_5[i]
,sCol_6[i]);
AfxMessageBox(sRow);
}
Art
|
|
|
|
|
You could try attending class
|
|
|
|
|
I am doing to embedded programming with a footswitch, I want a CButton to be 'pressed' when the footswitch is pressed and released when the footswitch is released?
Does anyone know how I can programatically give the CButton the 'Pressed' look?
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I suggest creating an owner drawn button that draws itself as pressed when it's truly pressed as well as when it's pressed property is true . Them it's a simple matter of doing:
m_button.setPressed (true);
m_button.Invalidate();
m_button.UpdateWindow();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
When you want to have the program press the button use:
::SendMessage(hwBtn,BM_CLICK,0,0);
Art
|
|
|
|
|
so that a Windows Media Player control 9.0 can be run at full screen mode.
If the control be run at full screen mode directly without sucking in keyboard presses, the system would hang after any non-system key pressed.
I am using VC++ 6.0. However, I still have some problems make the control run well at full screen mode.
Anybody can help? If you have some related articles or sample source codes?
Appreciate your help!
JW
DJ
|
|
|
|
|
hello,
i have a little problem when i want to capture bitmap.
I work in MDI project, i want to capture a view in Childwindow.
I can capture the view and save it in bmp file,It's work fine.
But if i my app is not in the foreground i capture a bitmap of the foreground app.
How can capture a bitmap of a view wich is not in the foreground (minized,or background) ??
thx for your help
Excuse for bad english
|
|
|
|
|
You do this by hiding your window, capturing the picture, and then showing your window again.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
thx for your answer !
there isn't another solution? there is not good if i must hide the app in foreground to capture the bitmap and show the app again.
|
|
|
|
|
hi.
i´m using an ADO-Recorset (_RecordsetPtr) and i need to know the number of records mached in the last SELECT. So i´m trying to do it by RecordCount, but it doesn´t work
el hombre es libre cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
It depends on your Connection::CursorLocation value. If you specify adUseServer you cannot access the RecordCount property.
pConnetion->CursorLocation = adUseClient will make the RecordCount property returning a value.
|
|
|
|
|
Thanks you very much. now recordCount is working very good.
but, do you know if adUseClient is slower than adUseServer ?
el hombre es libre cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
here's what MSDN says:
RecordCount Property
The cursor type of the Recordset object affects whether the number of records can be determined. The RecordCount property will return -1 for a forward-only cursor; the actual count for a static or keyset cursor; and either -1 or the actual count for a dynamic cursor, depending on the data source.
|
|
|
|
|
If you're going through all the records anyway then asUseClient won't be any slower.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|