|
The __declspec extension to support uuid may have been added after VC++6. I certainly never used it way back when. I don't have any docs capped at VC6 so I can't confirm it.
I'd use the old style
<br />
const IID IID_ISomeControl = {0x2212DD08,0x71C8,0x409d,{0x8A,0x50,0x96,0x66,0x12,0x16,0x6E,0xA8}};<br />
instead.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Actually, the problem was that another header file was doing:
#define _Exception void
and that was causing the compiler to freak out.
Thanks,
Stephen
I'm constantly improving every aspect of life. Not just my music, my rhymes but every facet requires its due attention to shine.
|
|
|
|
|
Matthew Faithfull wrote: The __declspec extension to support uuid may have been added after VC++6.
VC6 supports the uuid attribute of __declspec .
Otherwise it wouldn't be possible to use __uuidof() and I've used that one a lot.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello All,
i have dialog base application and I am try to create richeditctrl in oninitdiaog function follows :
m_RichEditCtrl.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE, CRect(10,10,100,200), this, 1);
but it doesn't show on dialog box
what i have forget please anyone tell me....
thanks
|
|
|
|
|
Hi,
Should work fine but...
Did you remember to enter AfxInitRichEdit2() in the InitInstance of the application?
Rolando
|
|
|
|
|
i forget this but now i have called this function but still it is now showing
what can be a problem?
|
|
|
|
|
Make sure you are calling the AfxInitRichEdit2() function at the begining of the application and not within OnInitDialog();
Also, did you declare m_RichEditCtrl as a CRichEditCtrl?
I tested this using VS 2005 version 8.0.50727.762 (SP.050727-7600) and your code was copied and pasted into the OnInitDialog without changes. All I then did was declare m_RichEditCtrl as a CRichEditCtrl.
Other than this I do not know what else to tell you. Hope this helps.
Rolando
|
|
|
|
|
Hello Guru
I am making an application for reading .txt file from Hard Hisk and
copy this file to folder and save it name in database.
In this program i can read data from hard drive and copy the file to
folder and also save its name in database.
Whenever i create a file in folder .(Its create successfully but
when try to reading contant of old file and writing new one an
assertion occor.
my code for that function is below.
CString str;
int ids;
CFileDialog Obj(TRUE);
if(Obj.DoModal() ==IDC_BUTTON3)
{
m_Upload = Obj.GetFileName();
}
str.Empty();
str = Obj.GetPathName();
SetDlgItemText(IDC_EDIT1,str);
///////////////////////////////////////////////////////////////////
/* reading file data from disk */
/////////////////////////////////////////////////////////////////
CString strLine = "";
CString buffer = "";
CStdioFile fileObj,filewrite;
CString fname;
fileObj.Open(str, CFile::modeRead | CFile::shareDenyWrite);
fname = fileObj.GetFileName();
// MessageBox(fname);
while(fileObj.ReadString(strLine))
{
fileObj.ReadString(strLine);
// fileObj.WriteString(fname);
buffer += strLine + "\r\n";
}
fileObj.Close();
// MessageBox(buffer);
SetDlgItemText(IDC_EDIT3,buffer);
fileObj.Open("c:\\UserFolder\\" + fname + ".txt",CFile::modeCreate,NULL);
Its run up to here successfully.
Its create a blank file in folder .
Now i am writing above code like this ( simple reading data from old file and writing it to new one an assertion occor . The code is below.
CString str;
int ids;
CFileDialog Obj(TRUE);
if(Obj.DoModal() ==IDC_BUTTON3)
{
m_Upload = Obj.GetFileName();
}
str.Empty();
str = Obj.GetPathName();
SetDlgItemText(IDC_EDIT1,str);
///////////////////////////////////////////////////////////////////
/* reading file data from disk */
/////////////////////////////////////////////////////////////////
CString strLine = "";
CString buffer = "";
CStdioFile fileObj,filewrite;
CString fname;
fileObj.Open(str, CFile::modeRead | CFile::shareDenyWrite);
fname = fileObj.GetFileName();
// MessageBox(fname);
while(fileObj.ReadString(strLine))
{
fileObj.ReadString(strLine);
// fileObj.WriteString(fname);
buffer += strLine + "\r\n";
}
fileObj.Close();
// MessageBox(buffer);
SetDlgItemText(IDC_EDIT3,buffer);
/*//////////////////////Copying file to another folder//////////////////////////*/
str.Empty();
fileObj.Open(str,CFile::modeRead);
while(filewrite.ReadString(strLine))
{
filewrite.WriteString(fname);
buffer += strLine + "\r\n";
}
fileObj.Open("c:\\UserFolder\\" + fname + ".txt",CFile::modeCreate,NULL);
How can i write content of old one to new one.
Any one Please told me .
Regard's
Kaushik
|
|
|
|
|
Hi,
Rather than reading the contents of the txt file to a buffer and then create and write it to the new file why not just do both at the same time?
<br />
CStdioFile fSrc, fDest;<br />
<br />
...<br />
<br />
while (fSrc.ReadString(strLine))<br />
{<br />
fDest.WriteString(strLine);<br />
}<br />
<br />
fSrc.Close();<br />
fDest.Close();<br />
Also, in your code you are missing the first line of the text file.
while(fileObj.ReadString(strLine)) <-- moves file pointer to next line<br />
{<br />
fileObj.ReadString(strLine); <-- reads next line. 1st line is gone!!<br />
...<br />
}
Finally, unless you are making changes or scrapping the text file for any data why not use the ::CopyFile function?
Hope this helps!
Rolando
|
|
|
|
|
I would agree strongly with using CopyFile unless there is some compelling reason not to. NTFS files can include information on file streams that you wouldn't see by simply opening, reading and writing. While this would be rare, it can happen.
Also, you would be setting permissions on the new file to those of the user running your program. This *may* be what you want, but not necessarily.
I'm sure there are other reasons I can't think of right now.
Iain.
|
|
|
|
|
|
COM,DCOM,COM+, then came .NET
I used DCOM a few times but I regret it since it's so darn slow. I found the books on DCOM and COM+ are better used as references for COM techniques than for the technologies they represent directly.
Rolando E. Cruz-Marshall wrote: Is DCOM still alive and kicking? Do I look at Web Services?
I could be way off, but from what I've seen DCOM was never really alive and kicking, IMHO.
|
|
|
|
|
In your opinion, is there an equivalent to DCOM in .Net? Is it Web Services?
It's been so long since I've worked with this I'm not sure which direction to go...
Rolando
|
|
|
|
|
IIUC, .NET uses COM behind the scenes, for some things... Note sure if specifically DCOM, but anything is possible.
If specifically asking about remote object access, then yes, SOAP and web services are likely the way to go.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Just a suggestion but for the Line monitoring I'd write a Windows Service and I'd have it talk to the client application using Sockets. Web technologies are not the best for Push applications where communications are initiated from the server end.
Also that way your client can be remote from the server. A two tier no Web no COM approach if you like.
If you do want a web front end then I'd go three tier with the web server hooking into a non visible version of the client app and for that I probably would use DCOM, or Connection Points or even a named pipe if the Presentation and Middleware layers could be combined. Depends if you'll need a Web Farm
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Excelent suggestion! I believe this would be the better way to go. I did not think about the Sockets. Cool.
Thanks for your help.
Rolando
|
|
|
|
|
I'm trying to make a dialog box appear from a file menu after clicking it with popup "Dialog" but i am getting the following error:
menu.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CGuessDialog::GetMessageMap(void)const " (?GetMessageMap@CGuessDialog@@MBEPBUAFX_MSGMAP@@XZ)
Debug/menu.exe : fatal error LNK1120: 1 unresolved externals
I have been unable to debug but the problem comes in when i use the following code in my .cpp
afx_msg void CMenusWin::OnBringDialog() //Function associated
//with message identifier for launching the dialog box
{
CGuessDialog dlg; //creating an instance of CGuessDialog to
//execute constructor on being clicked
dlg.DoModal();
}
I have a class CGuessDialog in a header file and have already made the resources manually.(i am not using the wizard)
Below is my message map:
//DECLARE_MESSAGE_MAP() has been done on the CMenusWin.
BEGIN_MESSAGE_MAP(CMenusWin,CFrameWnd)//CMenusWin contains the main window
ON_COMMAND(IDM_DIALOGLAUNCHER,OnBringDialog)//OnBringDialog declared
//in CMenusWin
END_MESSAGE_MAP()
Please help. I'm sunk!!
Thanks
TreeS
|
|
|
|
|
Wamuti wrote: menu.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CGuessDialog::GetMessageMap(void)const " (?GetMessageMap@CGuessDialog@@MBEPBUAFX_MSGMAP@@XZ)
Debug/menu.exe : fatal error LNK1120: 1 unresolved externals
You're probably missing a DECLARE_MESSAGE_MAP() in your CGuessDialog declaration.
Wamuti wrote: I have a class CGuessDialog in a header file and have already made the resources manually.(i am not using the wizard)
Well, create a dummy dialog with the wizard; compare the declarations and you should detect what's missing.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Ha! Thanks;).
I have gotten that bug.As i was going through the header file, i found I had made two DECLARE_MESSAGE_MAP(), one in CMenusWin class and the other in CGuessDialog class
It now works! Thanks so so much.
TreeS
|
|
|
|
|
Hi all,
I would like to know whether it is possible to construct a structure so that one of it's variables can be initialized with out the other being effected ?? i.e
struct foo
{
char a[128];
char b[128];
}FOODOO[100] = {"to A","to A again"};
Thanks in advance
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
If such a thing should work, then it would be :
= {{"to A",},{"to A again",},{...}};
But I hope for C++'s sake that this is not possible
I think you will have to go through an init function. BTW, this smells like a bad design ...
|
|
|
|
|
|
Hi All!
What is the difference between DLL and process???
amit
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|