|
How can I position a window to the bottom of a MDI client window, but above any statusbars/toolbars it has down there?
I got it done up to the part about client window, but the status/toolbars... no idea
I'm using MFC.
|
|
|
|
|
Hmmm. Using the MDI client window as a starting point, enumerate the client's child windows using EnumChildWindows , find the position of the free space within the client area from the positions of the child windows (which should include status and tool bars).
Software Zen: delete this;
|
|
|
|
|
QUESTION 1:
How do I deallocate the memory for input/output BSTRs from a VB client? ASP client? I cannot call SysFreeAlloc(...) from anywhere except in a C++ client.
Here's the idl for the method exposed by the interface:
[id(1), helpstring("method GenQuery")] HRESULT GenQuery([in] BSTR bstrParam, [out, retval] BSTR * bstrSQL);
QUESTION 2:
Do I need to Destroy my COM server object/instance? It's an inprocess dll-Apartment(both) ATL COM server.
Here's code for a VB client:
Private Sub btnQueryGen_Click()
Dim objQueryGen As QUERYGENALPHALib.QueryGenerator
Set objQueryGen = New QueryGenerator
Dim strSQL As String
strSQL = objQueryGen.GenQuery(Me.txtParam.Text)
Me.txtSQLQuery.Text = strSQL
'I cant objQueryGen = Nothing (runtime error 438: Object does not support this method or property)
End Sub
QUESTION 3 - destroy COM server?
What about from ASP?
norm
|
|
|
|
|
VB and VBScript handle all of that for you, AFAIK.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
what do u mean? what do u mean that VB.NET will handle all that...?
and what's "AFAIK"
norm
|
|
|
|
|
All scripting languages will do this for you. And yes, both VB and VB.NET will also. It helps however to clear the reference to your COM object after it has been used but you must use the Set keyword there also:
<br />
Set myObject = Nothing<br />
AFAIK : As Far As I Know
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Syntactically, is the keywork "Set" redundant, u think?
norm
|
|
|
|
|
No, VB requires it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hi, just built a simple COM object/server with ATL. It's inprocess-Apartment(both) server. Client is a simple VB application for testing purposes.
what's the better way of testing a COM server? ActiveX controller? Any good tutorial?
THanks!
norm
|
|
|
|
|
I do this every day at work, my components are called from VBScript, which means that if I attach the debugger to dllhost, I can debug them in VC++. I need to make sure the debug version is registered first, of course.
If they are run from a C++ app, the app itself is where the dll is run, so I attach to that. I presume VB would be the same.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thanks, how exactly can i do that? any good tutorial?
norm
|
|
|
|
|
Project/Debug/Attach To Process. That's all there is to it, VC will proceed to debug the process you point it to, and then you just load up the files from your COM component and set some breakpoints.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I usually test this way: A VB Project1.exe, with a Form1 and a Command1 button
If I want to test multi-threaded issues, I do the same with a C# client.
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
whoa, C#? this is sooo funky.
yes, i'm using a VB client with a good old Command1 button.
But i can step into the dll or exe code then. is there a better method?
and yes, if multithreaded, it becomes all the more a bitch...
thanks
norm
|
|
|
|
|
You can, in the "debug" settings for you app, tell it to launch vb.exe , set breakpoints and you're on your way.
Alternately, you can attach to the VB process, then launch your client.
|
|
|
|
|
QUESTION 1: are they the same? LPSTR and char *
QUESTION 2:
and what the heck is OLECHAR?
QUESTION 3:
I cant find the documentation for:
a. OLECHAR
b. LPSTR
QUESTION 4:
_TEXT()
_T()
QUESTION 5: if char is a Automation compliant data type, then why BSTR? and why Variant?
Thanks!
norm
|
|
|
|
|
norm wrote:
what the heck is OLECHAR?
It's a macro which in a Unicode build places an L next to the string like this
L"this is my value";
This has the effect of creating a Unicode string.
LPSTR is a long pointer to a string, I believe it's the same as char *. Microsoft like to 'create' types with MACRO's, I guess that means they can change them later ( like WPARAM and LPARAM ).
norm wrote:
_TEXT()
_T()
Never seen them before. Looks to me like member variables on an example string class in MSDN. They sometimes use _ instead of m_.
norm wrote:
if char is a Automation compliant data type, then why BSTR? and why Variant?
A BSTR is a wide string, you'd set one with the L from OLECHAR above, otherwise you get a char *. A _bstr_t wraps both types for you. A VARIANT is a whole different kettle of fish, it carries a lot more than just strings.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
norm wrote:
QUESTION 1: are they the same? LPSTR and char *
That's the same. LPSTR is preferred if you want to minimize the * in the signatures (it's more object-like).
norm wrote:
QUESTION 2:
and what the heck is OLECHAR?
OLECHAR = WCHAR = 16-bits = UCS2 = Unicode (the OS uses unicode strings internally).
norm wrote:
QUESTION 3:
I cant find the documentation for:
a. OLECHAR
b. LPSTR
look in <wtypes.h>
norm wrote:
QUESTION 4:
_TEXT()
_T()
see <tchar.h>
This macro produces either a simple char* string or a WCHAR* string depending on whether you are compiling in "normal" mode (SBCS, DBCS, MBCS), or in UNICODE.
Use it instead of L"xxxx" which always produces a WCHAR* string regardless of the compilation mode.
Using _T(x) is also a good idea to remind yourself where are the hardcoded strings (internationalisation).
norm wrote:
QUESTION 5: if char is a Automation compliant data type, then why BSTR? and why Variant?
BSTR is an all-in-one string : Unicode, content itself, length.
A char* is not a typed string (can you figure out the codepage in it ? Answer = no). A char* does not have the length embedded (you could do a _tcslen(string) on it, provided it ends with a 0, etc., etc. ==> Many issues with a char*
VARIANT is a C-union struct. Introduced mostly because of VB (which hides all the type mapping for you) and other automation languages.
|
|
|
|
|
|
thanks mike, will read them now.
norm
norm
|
|
|
|
|
How do you get Visual C++.NET to recognize float data less than zero? For instance, if the following were typed:
float someint=(9/12); The program sees this as zero and not 0.75.
|
|
|
|
|
put decimal points after the 9 and 12
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
9 and 12 are both integers, so that expression does integer division, thus the result is zero. Write it with floating-point constants:
9.0/12.0
to get the desired result.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
hey everyone, i'm fairly new to MFC so forgive me if this is easy, but my View class is a CListView(in report mode) and i follow some i examples i found to get tabs working, by having a member varible in the View class and setting up the tabs in the view classes OnInitialUpdate, and now i have tabs but the header on the ListView apear over the tabs, which i want the list view to look like its in the tabs. any ideas?
should my View class be derived from tab class and create a ListView class in it? not the other way around? i tried a quick hack at that but got errors, but if that was right i'll have another go.
maybe i could make it draw the listview lower?
anyway thanks in advance.
Luke.
|
|
|
|
|
Hi, everyone!
I am a newbie of MPEG4. First, I want to learn what is MPEG4.
Then I want to write a simple MPEG4 encoder/decoder. (Using C++)
But I can not find any documents and samples at hand.
Anyone know how can I find the resources?
(1. A step by step doc for newbie of MPEG4.)
(2. A simple encoder/decoder sample code.)
Thanks & nice weekend,
George
|
|
|
|