|
|
What do you mean? Are you crazy?
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
MailtoGops wrote:
What do you mean? Are you crazy?
May be!!!! that's why, he behaving like that..................
"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 am extremely sorry for this.I had a problem posting the message due to login problems.I just wanted to check whether i was able to post a message or not.
|
|
|
|
|
ashwath2005 wrote:
I am extremely sorry for this.I had a problem posting the message due to login problems.
It's OK!
"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
|
|
|
|
|
|
|
The following questions just came into my mind:
Having high expectations for VS.NET 2005 and Managed C++, I asked myself whether it is possible to take my current unmanaged project and simply set the "Managed"-switch ("/clr" or something like that, I recall) and then recompile.
I then thought that this will only be possible if MFC would be recompiled as Managed, too.
Is this correct? Or can I have a fully managed C++/MFC application without a Managed MFC version? Or is my whole question stupid? C'mon Nish, give me a clue
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
Respected All
Regards
I sent a thread yesterday and also recived replies from respectable members but unluckily that did not work,
my post was.
-----------------------------
Respected all
Reagrds!
thanks for replies,but unluckily those did not work.
my yesterday query was.
---------------------------------------------
Respected All
I am engaged with filereading problem since long time, i readed the file but still problems are coming.
the dat file is in the following form.
-----------------------------------------
;sfad
;sdlfgs
;sdfjsd
;X Y Index
12 12 1233
34 45 1244
66 44 2435
45 23 3455
;fgksdghkdfhgdf
;dflghfd
23 67 6788
23 45 2334
-------------------------------------
now in the above file format i has to read only the lines that's starting without SEMICOLON and all the lines starting eith SEMICOLON has to skipp.and also while reading each line of the file I has to put the X,Y and Index value in seperate Array and the same process will be repeated each time for X,Y and Index value.
my code script is following
---------------------------------------
int val1,val2,val3;
int row=0;
char str4[50];
pfile=fopen("filename.dat",r)
do
{
fgets(str4,sizeof(str4),pfile);
if(str4[0]!=';')
{
fscanf(pfile,"%d",val1)
arr1[row]=val1;
fscanf(pfile,"%d",val2)
arr2[row]=val2;
fsacnf(pfile,"%d",val3)
arr3[row]=val3;
row++
}
while(!feof(pfile))
fclose(pfile);
-----------------------------
its reads all the data correctly but when there is a SEMICOLON in the start of the line then its skipp the next one line(immediate lines) and reads after it.
in the above case it skipp the line
12 12 1233
and
23 67 6788
because before these two lines there was a SEMICOLON line and due to it skipp the immediate lines.
and except these 2 lines it reads all the lines accordingly,
I dont know why this problem is coming,, pls guide me that what is the best method in this case while i am reading the above file format.
waiting for + response.
------------------------------------------------------------------
The respected members suggests that use
int val1,val2,val3;
int row=0;
char str4[50];
pfile=fopen("filename.dat",r)
do
{
fgets(str4,sizeof(str4),pfile);
if(str4[0]!=';')
{
sscanf(str4,"%d",val1)
arr1[row]=val1;
sscanf(str4,"%d",val2)
arr2[row]=val2;
ssacnf(str4,"%d",val3)
arr3[row]=val3;
row++
}
while(!feof(pfile))
fclose(pfile);
--------------------end of thread----------------
remember that i am working on VC(MFC) envirnment,
but after execution like the above code it give error,and the error window come although there is execution error and compilation is succeffull.but did not execute.so if any MFC related method then kindldy guideme
so needs suggestion 1ce again,plz.
david
|
|
|
|
|
a_david123 wrote:
because before these two lines there was a SEMICOLON line and due to it skipp the immediate lines
I somehow cannot understand this. Have you run the debugger to see why it skips the next line ? Is the fgets skipping one line when reading the file, or is fgets OK and your code not handling that one line (due to the str4[0]!=';' )?
~RaGE();
|
|
|
|
|
Use this code..
I used MFC...
CFile fRead;
if (fRead.Open ("test.txt",CFile::modeRead))
{
CArchive aRead(&fRead,CArchive::load);
BOOL bDataAvail;
CString csReadString;
while ((bDataAvail = aRead.ReadString(csReadString)))
{
// Don't display line with semicolon
// If you sure about the first char is semi colon
// then you can use this statment
// against current (csReadString.GetLength() > 0 && csReadString[0] == ';')
if (csReadString.GetLength () == 0 )
continue;
if(csReadString.Find(";") > -1)
{
// Don't do skipp this
continue;
}
else
{
cout << endl << endl << "Read is " << csReadString.GetBuffer (0) << endl;
int val1,val2,val3,val4;
sscanf(csReadString.GetBuffer(0),"%d%d%d",&val1,&val2,&val3);
cout << endl << "Val 1 is " << val1;
cout << endl << "Val 2 is " << val2;
cout << endl << "Val 3 is " << val3;
}
}
aRead.Close();
fRead.Close();
}
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hello All,
Do anybody know some of the tutorials on creating ocx controls in VC++.
Neelesh K J Jain.
|
|
|
|
|
You are in the right forum . But minutes away from the tutorial ..
Search it !!! here itself
redindian
|
|
|
|
|
Hello Friends,
I have developed a package which uses a .mdb file and a .ocx control. I want to create a Installshield which will register the ocx control and create the mdb file.
But I don't know how do the above things. Please help regarding this one.
Neelesh K J Jain.
|
|
|
|
|
Hi all,
I would like to know if any way to find the Font Height and Font Width using the Font Size.
for ex, If Font Size is 12, how to calculate the Font Height and Font Width..
Thanks,
Shiva P
|
|
|
|
|
Hi,
Font size is measured by the height and width, not by single unit called size..
EnumerateFonts also won't workout..
What are you tring to get out?.
Do you want to measure the displayed tex height and width?
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Thanks Gopal,
But I need to give the user option as a single unit of font size as in Winword, excel, where the user selects from 8 to 12..
Internally I need a mapping for the same in terms of display height and width..
Shiva P
|
|
|
|
|
Try this...
MulDiv function will give you and equivalent of font size you provide ( I have provided 19).
Hope this helps
CFont font;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
HFONT hFon=(HFONT)::GetStockObject(DEFAULT_GUI_FONT);
if(hFon)
{
CFont *pFont = CFont::FromHandle(hFon);
pFont->GetLogFont(&lf);
}
else
_tcscpy(lf.lfFaceName,_T("Arial"));
lf.lfHeight = -MulDiv(19, GetDeviceCaps(dc.GetSafeHdc(), LOGPIXELSY), 72);
_tcscpy(lf.lfFaceName,_T("Trebuchet MS"));
lf.lfCharSet = DEFAULT_CHARSET;
font.CreateFontIndirect(&lf);
Steve Mayfield: "Coding in VB is like riding a tricycle...once you figured out how to peddle, its really hard to fall off."
My Articles
|
|
|
|
|
I have a Output view in my application which inherits from the MFC CScrollView. In the Output View the application displays text information. I want to provide a ability such that on clicking a button the entire content of the Output view gets cleared.
I am a MFC newbiew and do not know how to achieve this. Any help/sample code will be greatly appreciated.
Thanks,
Susmita
|
|
|
|
|
The output view is just a control isn't it ? So SetWindowText("") should clear it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
SetWindowText("") does not do it.
I saw in the code that when ever anything is displayed in that View, the view's OnDraw(CDC* pDC) Method is called.
Do I need to explicitly call it when I need to clear it?
|
|
|
|
|
Hi Susmita,
I could not give you answer still I haven't understood what you do in displaying the text in output view.
1. Is your Output view has OnDraw(...) or OnPaint() message handler to paint your document data on the output view?
2. Clear has different meanings.. Clear the View means do you want to clear the data which is stored in Document object?
3. OR you won't clear the document object content, but do you want to display some background color on the view?
For Option 3, what you can do is
1. Have one boolean variable which is funtioning like a toggle
2. When click the button to clear the view, set the bool to true (bClear = true. Now you have to Invalidate the view/window(Which will send WM_PAINT Message and call your OnDraw / OnPaint Message handler)
3. In the OnDraw/OnPaint handler check for the boolean flag (bClear)
4. if bClear is true, then do not call any paint related function
Sample Code
IMPLEMENT_DYNCREATE(CPaintTestView, CView)
BEGIN_MESSAGE_MAP(CPaintTestView, CView)
//{{AFX_MSG_MAP(CPaintTestView)
ON_COMMAND(ID_VIEW_CLEAR, OnViewClear)
ON_UPDATE_COMMAND_UI(ID_VIEW_CLEAR, OnUpdateViewClear)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
..
..
...
CPaintTestView::CPaintTestView()
{
m_bClear = false;
}
/////////////////////////////////////////////////////////////////////////////
// CPaintTestView drawing
void CPaintTestView::OnDraw(CDC* pDC)
{
CPaintTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (m_bClear)
{
}
else
{
pDC->TextOut (20,20,"I Love Bangalore");
}
}
void CPaintTestView::OnViewClear()
{
m_bClear = !m_bClear;
InvalidateRect(NULL,true);
}
void CPaintTestView::OnUpdateViewClear(CCmdUI* pCmdUI)
{
if (m_bClear)
{
pCmdUI->SetCheck ();
}
else
{
pCmdUI->SetCheck (false);
}
}
I hope this will help you..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hello everyone:
I want to drag a self-customaze stuct from a edit of A dll, and Drop the struct to a edit of B dll. Please help me how to do?
Thanks.
-Freehawk
|
|
|
|
|
Playing around with some registry stuff....
I'm making a call to RegQueryValueEx() with the returnstring buffer that is 4K. I am continually getting a system error code of ERROR_MORE_DATA. When I look at the data in the dubugger, it's about 400 characters.
Could there be another problem that would give that error code?
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Nobody has seen this or had this problem?
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|