|
WhiteSky wrote: See Here[^]maybe it is some helpful to you
I agree with Mr Stephen [HERE][^] for same!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
KongHL wrote: how am i going to use the AfxBeginThread??
Like this:
<br />
AfxBeginThread(CRuntimeClass* pThreadClass,<br />
int nPriority, UINT nStackSize, DWORD dwCreateFlags,<br />
LPSECURITY_ATTRIBUTES lpSecurityAttrs)<br />
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
How do you specify file names to CFtpConnection::PutFile that have blank characters. Blanks are common to make file names readable now days, but the usual tricks like putting the sting in quotes does not allow it to work. Has anyone found a way to deal with this?
Thanks
Ray
|
|
|
|
|
Copy the file name into CString and then pass this Cstring variable to the function.
CFtpConnection::PutFile
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Thanks for the input Gnaesh,
I am calling CFtpConnection::PutFile with two arguements, both are CString. When I have a file name without blank characters embedded, then it works fine, but if I have a blank, then I get the following error:
PutFile failed for "C:\C3ilex\EOScada\Displays\Sample Demo Display Index.DXF" with 12003, 200 Type set to I.
200 PORT command Successful.
550 Sample Demo Display Index.DXF: Access is denied.
The message is generated with the following call:
GetApp()->LogFtpError(_T("PutFile"), lpszPathName, error, true); (lpszPathNmae is the file name with path.
Any more thoughts?
Thanks
Ray
|
|
|
|
|
If you are assigning static path in PutFile as:
"C:\C3ilex\EOScada\Displays\Sample Demo Display Index.DXF" it won't work.
For that you have to give the string as :
"C:\\C3ilex\\EOScada\\Displays\\Sample Demo Display Index.DXF"
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Thanks again, but are you saying that if I don't have blanks in the name, for example if I were to use:
C:\C3ilex\EOScada\Displays\Sample_Demo_Display_Index.DXF
you would expect it to work, but if I used:
C:\C3ilex\EOScada\Displays\Sample Demo Display Index.DXF
you would expect it to fail?
Thanks
Ray
|
|
|
|
|
Thanks for the help. I think I am out of the woods on this now!
Thanks
Ray
|
|
|
|
|
I'm trying to figure out how to do a few operations using functions and arrays: cardinality, union, intersection, difference, subsetOf, properSubsetOf, and elementOf. I'm using integer arrays but i have no clue how to get this started. any help would be great
pp944
|
|
|
|
|
Use STL. For example the following will calculate the intersection of two sets:
--------------------------
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <algorithm>
#include <iterator>
using namespace std;
int main(int argc, char* argv[])
{
int set1[] = {1, 2, 8, 3, 7, 11};
int *pSet1End = set1+(sizeof(set1)/sizeof(*set1));
int set2[] = {7, 9, 16, 2, 15, 8};
int *pSet2End = set2+(sizeof(set2)/sizeof(*set2));
// Must be sorted to use set operations.
sort(set1, pSet1End);
sort(set2, pSet2End);
// Calculate and output the intersection.
set_intersection(
set1, pSet1End, // The first set
set2, pSet2End, // The second set
ostream_iterator<int>(cout, "\n") // Where to put the results
);
return 0;
}
Steve
|
|
|
|
|
I have a problem in reading parallel port with Microsoft Visual C++ 6.0,
for reading or writing the parallel port I use small assembly code and it work correctly,then i defined a windows timer that its routine, called minimum every 1 mili second and in that i use readport function , i couldnt find any timer less than this amount,
so this is a problem for me because i want to read parallel port nearly every 20 Microseconds .
is this type of timer exist????
or get me some idea about using interrupt on this event.
thnx
|
|
|
|
|
I am trying to update my CViews related to my CDocument. In order for the program to remain resposive as data is read from a file, I need to start a seperate thread to do the reading and updates. The problem I am running into, as I understand it, is that I cannot use C++ objects in this thread. The code I have is:
<br />
while (m_bRunThread)<br />
{<br />
<br />
this->UpdateAllViews(NULL); <br />
}
Is there a way to accomplish what I want to do?
Thanks.
|
|
|
|
|
masnu wrote:
this->UpdateAllViews(NULL); //ERROR HERE
What error?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
typically, you'd have a UI thread and a worker thread. the UI thread would (obviously) handle the UI updates, and would communicate anything to the UI anything the worker thread had to say. in other words, you wouldn't have two separate threads talking to the UI.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
MFC uses thread local storage to maintain it's map of CWnd objects to HWND. So only the UI thread will have this data structure. There are Knowledge base articles on MSDN about this.
Look at using PostThreadMessage to communicate events from the worker thread to the UI thread. Be sure to apply synchronization where necassary to avoid corrupting data.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Doing anything extensive in your UI thread is asking for trouble. Often causes your UI to become unresponive.
Put your big file operation (and other I/O -- i.e. networking) into a worker thread.
Once your big operation is complete, you can post a message to the UI thread.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
hello,
i have a cstring like this:
item1,item2,item3,item4,etc is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox.
(something like php's explode() function: http://us2.php.net/explode)
thanks in advance
|
|
|
|
|
Are you looking for AfxExtractSubString() ?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Used that. Thanks for the tip.
|
|
|
|
|
use Tokenize()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Sam Kline wrote: is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox.
see example quoted in Help of CStringT::Tokenize in MSDN!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have a dropdown combo box that needs to be able to accept new entries not listed in the combo box via the edit control. If I create the member variable as a value instead of control, I'm able to save the selection or text input, but how do I display it in the edit control when I reopen the window. I tried the following:
private:
CString test_value;
test_value = m_test; //Saves the selection
//m_test = test_value; //tried this first
GetDlgItem(IDC_TEST)->SetWindowText(m_test); //this didn't work either
UpdateData(FALSE);
Please help! Thanks.
|
|
|
|
|
elephantstar wrote: GetDlgItem(IDC_TEST)->SetWindowText(m_test); //this didn't work either
UpdateData(FALSE);
does SetWindowText still not work if you get rid of the UpdateData call ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
|
Hi,
I don't have more knowlegde about VC++, but try following if it can satisfy your requirement.
CComboBox *combo = new CComboBox();
combo->m_hWnd = GetDlgItem(IDC_TEST)->m_hWnd;
combo->AddString("AS");
combo->AddString("ZX");
m_combo = "ZX";
UpdateData(FALSE);
Try it.
Best Regards,
Aniket
-- modified at 9:07 Friday 19th May, 2006
|
|
|
|