|
You can write programs of two kinds using VC++ 7, unmanaged and managed. Unmanaged programs are using WIN32 API and optionally some libraries like MFC or ATL, nothing from .NET, it's the same programming as in previous versions with new IDE and some new features in libraries and compiler. Managed ones are interfacing with .NET framework using MS specific language extensions. .NET framework is an environment very similar to Java with bytecode(called MSIL here), garbage collector, objects and interfaces, rich libraries, see this[^].
Pavel
Sonork 100.15206
|
|
|
|
|
Hello there,
It's my string that i added to Rich edit box:
Ali
Hadi
Asghar
I wrote them by my own function AddText:
AddText(m_Rich, "Ali\nHadi\nAsghar");
The problem is when i get the len, i got differet results in different OS ...
As i can remember, the result was same in Win98 and WinXP
But len was different in Win2000
I think the problem in for Enter character !
So, how can i get real len in Win2000 ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Thats a weird one.
Hadi_Rezaie wrote:
"Ali\nHadi\nAsghar");
I count 3+1+4+1+6 = 15
But the enter and lf would quite possible make 16 || 17
If it's a CString could you not perform a simple Replace on the text before input eg
m_Rich.Replace("\r","");
or use
m_Rich.TrimRight();
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
Hello Colin
And thanks for reply ...
I used CRichEditCtrl, not CString !
In my real program i added the text like this:
AddText( "Ali" );
AddText( "\nHadi" );
AddText( "\nAsghar" );
Could u solve my problem from above code ??
I didn't understand why you used m_Rich.Replace("\r","");
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Does anyone know how I can set a timeout value for the connect() method of a socket? If it can't connect within about 200ms then I know that it never will.
At the moment the connect is waiting for about 5-10 seconds before it returns.
My code below:
<br />
target.sin_family = AF_INET;<br />
target.sin_addr.s_addr = *(long *)(host->h_addr);<br />
target.sin_port = htons(port);<br />
s=socket(AF_INET,SOCK_STREAM,0);<br />
<br />
if (s<0) exit(printf("Error creating socket.\n"));<br />
if (!connect(s,(struct sockaddr *)&target, sizeof(target)))<br />
{<br />
}<br />
if (closesocket(s)) exit(printf("error closing socket.\n"));<br />
<br />
|
|
|
|
|
I think you can use Winsock's "select" statement. Take a look at that along with the TIMEVAL structure.
Oh yeah, that only works on Winsock 2.0
|
|
|
|
|
Using Visual C++.NET, I want to insert a IWebBrowser2 control. I have created a class with the "Add Class" wizard choosing "MFC Class From ActiveX Control". It worked fine and the class was added.
I then add 2 controls in my dialog. How do I bind them to variables of the class I added. When right-clicking on the control, the "Add Variable" item is disabled from the context menu, and the "Add Class" don't show the ActiveX class from the drop-down.
How do I do it? It was so easy in Visual C++ 6.0, but now it seems very difficult.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Never mind, it is a UBF (User Brain Failure).
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hello there,
I used Crystal Report ActiveX in my program ...
Please tell me which DLLs i have to register in user computer ?
Please tell me DLL names ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
As i recall, there's a utility that comes with CR that will figure it out for you, based on what features you use. If nothing else, the list should be in one of the help files also.
---------------- Shog9 ----------------
------- Drink Coca-Cola -------
---- Use SciTE ----
|
|
|
|
|
Thanks
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi guys,
I'm getting an assert failure from the following code.
//This is the class which holds the CListBox
CTestDlg::DoDisplay()
{
CListBox *box = (CListBox*)GetDlgItem(IDC_LIST);
//the above line throws an ASSERT
box->InsertString(-1, "It's Good");
}
And.....
//Class which generates the data to be added to the list
CDisplay::Foo()
{
CTestDlg dlg;
dlg.DoDisplay()
}
Assertion Error exactly is:
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem); }
And the I've already tried this with modal and modelss dlgs and nothing successful. And yes, the listbox is initialized and is visible in the program. In a nutshell, the DoDisplay() works (adds data to the listbox) inside the class of its own and doesn't when it's invoked outside of its owner class. Can you guys help me?
|
|
|
|
|
Licensed2Code wrote:
ASSERT(::IsWindow(m_hWnd));
This test is failing because the dialog window isn't created (m_hWnd is NULL) until you call DoModal().
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Mike,
So, how would you modify the code? I really apprecite it.
Hav a great one.
Jey
|
|
|
|
|
Call DoModal() to create the dialog, then in OnInitDialog() do whatever control setup is necessary.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Mike,
The Dialog is already running and in there I got the List Box.
When I press a button, it processes data from one class and sending it to the dialog class.
I've already called the DoModal() in the beginning of the application part of th InitInstance() function.
This is how it's.
CTestDlg::DoDisplay(CString sString)
{
CListBox *box = (CListBox*)GetDlgItem(IDC_LIST);
box->InsertString(-1, sString);
}
and when I press a button named "Register" from the dialog (from CTestDlg class), it calls up the following function......
CDisplay::DoRegister()
{
CTestDlg pDlg;
CString sString = "I don't know what to do";
pDlg.DoDisplay(sString);
}
The assert is thrown at the line "CListBox *box = (CListBox*)GetDlgItem(IDC_LIST);" saying IsWindow()==mHandle == NULL.
Since I've already called up the DoModal() at the beginning, I don't see why I've to call it again, and calling it again will create another dialog.
Your help is appreciated.
Jey
|
|
|
|
|
Fill the dialog with data in WM_ONINITDIALOG message handler and use it this way:
<pre>
CDisplay::Foo()
{
CTestDlg dlg;
dlg.DoModal()
}
</pre>
Pavel
<small><a href="http://www.sonork.com">Sonork</a> <b>100.15206</b></small>
|
|
|
|
|
I've already invoked the DoModal() in InitInstance() part of the application. And if I do it again, it would create another dialog which I dont' want. Anyother ideas???
Thanks...
Jey
|
|
|
|
|
Currently I'm using
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
I could easily do the same thing with SendInput() but my question is, is this the right way to simulate a doubleclick?
-Jack
If things are as bad as they can be, you can be sure there'll be a brighter tomarrow.
|
|
|
|
|
According to the MSDN the mouse_event function has been superseeded by the SendInput() function so i think it would be best to use that.
|
|
|
|
|
My program worked fine two minutes ago, but now when i enumerate a list with ACM compressors, i get a "Unhandled exception at 0x77f767cd in MP3.exe: User breakpoint." Why does it do that? I have never had problems with that before. It happens when i open an ACM driver:
acmDriverOpen(&hacm, hadid, 0);
It's opened inside an enumeration function where i get a HACMDRIVERID delivered inside the function so it should be valid. Anyone have some info on "user breakpoints" or know what could be wrong?
Thanks in advance.
-Rune Svendsen
|
|
|
|
|
Your program got lost probably and jumped randomly somewhere into memory. Maybe a stack was damaged before returning from a function.
Pavel
Sonork 100.15206
|
|
|
|
|
Any idea how to fix that?
Thanks
|
|
|
|
|
Hi dear,
How can I split a MPEG file into two or several small files or merge two or several MPEG files to one file?
What about DAT file?
Thank you.
|
|
|
|
|
I know there is a program which will patch it for VS6, but has one been released for .NET?
|
|
|
|