|
Sounds too easy... but is working!!
Thanks
|
|
|
|
|
I have a listview on a dialog, and I want to set a dialog variable, when the user clicks a column header (which sorts the list view on that column, and I want to save which column and the sort order in that variable). Problem is, I searched all over MSDN, and I can't find a "user clicked listview X" Message Map from the main dialog (so that when the user clicks a column header, the main dialog then goes to the listview (a derived lv class which has a function to return column number and sort order) and gets the column number and sort order. Though there are ways I could work around this, it would be the cleanest implementation possible. Anyone have any ideas, or if there is an "list view header clicked" message map for the dialog?
|
|
|
|
|
Notification messages are sent to a control's parent. That means that header notifications are sent to the list control, not your dialog. You'll need to write a CListCtrl-derived class and use that in your dialog. The list can then either handle the sorting or send a private message (such as WM_APP) to the dialog to make the dialog do the sorting.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Hi all,
I'm writing simple ActiveX with MFC ActiveX Wizard ...
I have problem in my properties ...
I add new property: Disable(external name and BOOL m_disable member variable and void OnDisableChanged() notification function).
I add Checkbox to my property page for changing Disable property ...
I wanna add member variable for the Checkbox, but i can't see my property name in 'Optional property name' section in Add Member Variable dialog !!!
How can i solve it ?
In last, what is 'Optional property name' performance ?
Help me, plz ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I writed ATL COM DLL via AppWizard and added to it ATL class "AtlObj".
after I imported function from Extention DLL that I created before. so:
------------------------------------------------------------
extern "C" __declspec(dllimport) void ShowDialog();
STDMETHODIMP CAtlObj::show()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
AfxMessageBox(".....");
ShowDialog();
return S_OK;
}
-----------------------------------------------------------
The problem : When I run it by client program (exe) the atl it works !
but the imported function (ShowDialog) dont performed. WHY ????????
|
|
|
|
|
I didn't answer yesterday because I'm not really knowledgable with regard to dll's in general. But have you tried putting in a breakpoint to see what happens if you trace into your ShowDialog function ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Does CString and LPCTSTR only carry as much as 256 characters or is there a way to augment this to carry what I want. I have a SQL query that is 289 characters long and I'm needing a string variable that could carry it.
(shuffling through MSDN. yuck)
Thanks!
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
CString doesn't have a 256 char limit.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Nope. If you dig through the MFC Source, you'll discover that it stores the string in a LPTSTR variable called m_pchData. Looking further, LPTSTR is defined as char * or wchar * (depending on whether or not you're using UNICODE). So in essence, CString can handle strings as large as your have memory for.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
CString::GetLength() returns an int [32 bit number in win32]
So I guess if you have that much RAM, then that's the limit....
a 32 bit number can have a max value of 4,294,967,295
and GetLength() returns the byte count
thus we can have that many bytes [approx 4.29 GB] in a CString
Hmmmm
wait wait wait
I think int means signed-integer
if that's the case then we only have 2.14 GB
Nish
|
|
|
|
|
It's not unsigned, so it's 2gb.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
We're making an ATL object to be used in ASP or Visual Basic.
I want to be able to return a BSTR to make it nice and pretty for my VB partner.
Ok ok, we all know that you can say...
///////////////
STDMETHODIMP Foo([out,retval] BSTR outstring)
///////////////
..and have it returned in a variable in the Implementation. (duh)
But can we get this a function in an object to look like:
///////////////
BSTR Foo(BSTR instring);
///////////////
or just something with the emphasis on returning a BSTR in the "real" return parameter place.
"The Master Wang" doesnt have money to buy a COM or ATL book...
and plus I know I'm asking questions from the best!
SHABBA!!
*Please Contact Me if you have a Donation to give to a poor college student who needs money for a engagement ring for the greatest girl in the world.
-~= The (still learning) Master Wang =~-
SHABBA!!
|
|
|
|
|
STDMETHODIMP Foo([out, string, retval] BSTR* outstring)
cheers!!!
Carlos Antollini.
|
|
|
|
|
hey, cool, umm... can you explain "how it works"? i kinda need to know why i'm doin' this. One more question (which is most important), in VB am i gonna be able to say:
(VB mumbo jumbo)
set thingy = STRTESTLib.blahblah
dim StringAction
///////////////////////
StringAction = thingy.WhatStringDoIHave()
///////////////////////
^^^This is what i want it to look like.
So what you just showed me will let me do this?
SHABBA!!
|
|
|
|
|
You will must to register your object for example STRTESTLib. You must to use the lib in your VB project with the option Components...
If your interfase is STRTESTLib.blahblah
From VB, you will must to do this.
Dim thingy As New blahblah
Dim String as string
String = thingy.WhatStringDoIHave
Best Regards....
Carlos Antollini.
|
|
|
|
|
sweet dude! ok it works.. i'm sure that was something simple, but when you dont have a book, things get incredibly stupidly difficult because you dont know what things are.
great, thanks again!
\\\\\\\\
Tim
SHABBA!!
|
|
|
|
|
Can I recommend the book 'ATL Internals' as the *best* ATL book, especially if you already know enough to not need a 'how do' for basic things.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
How could I abort an http download if the connection is too slow?
For instance, if I have this code using MFC_Tear_Sample
void getHttp()
{
CString pszURL = "http://weather.noaa.gov/weather/current/";
CString uneURL;
BOOL bStripMode = FALSE;
DWORD dwAccessType = PRE_CONFIG_INTERNET_ACCESS;
DWORD dwHttpRequestFlags =
INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT | INTERNET_FLAG_RELOAD;
const TCHAR szHeaders[] =
_T("Accept: text/*\r\nUser-Agent: MFC_Tear_Sample\r\n");
FILE *fp1;
int nRetCode = 0;
CTearSession session(_T("TEAR - MFC Sample App"), dwAccessType);
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
uneURL=pszURL+selEstacion+".html";
try
{
// check to see if this is a reasonable URL
CString strServerName;
CString strObject;
INTERNET_PORT nPort;
DWORD dwServiceType;
if (!AfxParseURL(uneURL, dwServiceType, strServerName, strObject, nPort) ||
dwServiceType != INTERNET_SERVICE_HTTP)
{
MessageBox(0,"Error: Solo se pueden usar direcciones que comiencen con http://","Error en URL",MB_OK);
ThrowTearException(1);
}
pServer = session.GetHttpConnection(strServerName, nPort);
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET,
strObject, NULL, 1, NULL, NULL, dwHttpRequestFlags);
pFile->AddRequestHeaders(szHeaders);
pFile->SendRequest();
if((fp1=fopen("temp.htm","wb"))!=NULL)
{
TCHAR sz[1024];
while (pFile->ReadString(sz, 1023))
{
fputs(sz,fp1);
}
httpLeido =TRUE;
}
else AfxMessageBox("No se han podido encontrar, en estos momentos, datos sobre dicha estación");
fclose(fp1);
}
catch (CInternetException* pEx)
{
// catch errors from WinINet
CString szErr;
szErr.Format("Internet Exception Error %d", pEx->m_dwError);
MessageBox(0,szErr,"ERROR",MB_OK);
pEx->Delete();
}
catch (CTearException* pEx)
{
// catch things wrong with parameters, etc
nRetCode = pEx->m_nErrorCode;
TRACE1("Error: Exiting with CTearException(%d)\n", nRetCode);
pEx->Delete();
}
if (pFile != NULL)
{
pFile->Close();
delete pFile;
}
if (pServer != NULL)
{
pServer->Close();
delete pServer;
}
session.Close();
}
|
|
|
|
|
Hey!
I developed an ActiveX control, using ATL, and then packed it inside a CAB file, and signed the file.
Then I created an HTML with the proper <object> tag and everything, and tried it out. Worked great on my Win2k. Also works great on Win98/ME.
Doesn't work on Win95 (IE5) or WinNT4 (IE5.5).
The problem on both platforms seems to be the same - the CAB is downloaded, the "Do you trust..." dialog box appears. I click YES. Then the icon on the top left corner of the rectangle where the control should appear, changes to reflect the fact that the component can't be downloaded.
Since components are downloaded to C:\WINDOWS\Downloaded Programs - I checked this directory - and couldn't find the DLL there!
Perhaps this is the time to mention that my DLL in the CAB has a DLL extension, not OCX (does it / should it matter?)
I also didn't write an INF file. The DLL is the only file contained in the CAB.
Any suggestions?
Thanks,
Oz
|
|
|
|
|
i have got one problem.. i am sending an html - email with some user-defined variables..
first i have used a temporary file, which was really great, cause i could use the very convient << to add data to the file...
now i tried to use cstrings (if it just works with std_strings it is no problem though) and i'm really sick of the '+='.. cause i jsut can add one thingy add a time.. otherwise it says that it can't add pointers...
anyone knows something like << for strings (if i have to use stl - strings.. no problem though)..
i just don't wanna use a file.. and i'm sick of the '+='
thanks in advance
bernhard
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
anyone knows something like << for strings (if i have to use stl - strings.. no problem though)..
Sure, check ostringstream out. Welcome to iostream C++ library.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
My Visual Studio is crashing when I right click on any control in a resource dialog.
I get this error.
The instuctions at "0x519f112c" referenced memory at "0x00000004". The memory could not be "read"
I am using VC++ 6.0 on Windows 2000 with WndTabs and Visual Assist.
Any ideas why this is happening?
thanks
Kant
|
|
|
|
|
Sorry about that,
I'm trying to figure out how to format a c string or a standard string.
How do I make it bold, change the colour and size of it etc?
Cheers
Jon
|
|
|
|
|
a cstring or a std_string are just reprasentatives of a string.. it's in the program.. i think your questions is: i have got an edit box.. how do i underline... it in the box ...
is this your question or am i wrong???
bernhard
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|