|
It has to do with COM and Automation. It is basically just a wrapper for any possible type of data you can transmit through Automation. I think it was designed like that to work with Visual Basic better...
Even if you win the rat race, you're still a rat.
|
|
|
|
|
I want to make a serial port communication program. I define a STRUCT variable
struct _COMM_PACK
{
char sID[PACK_ID_LEN];
BYTE cCmdCode;
UINT nVerifySum;
int nDataLen;
BYTE cData[MAX_DATA_LEN];
}aSendPack;
and want to send 'aSendPack'in the Mscomm control-comm like:
comm.SetOutput(aSendPack);
but the SetOutput need a VARIANT variable
how can I do that?
thanx!
|
|
|
|
|
|
Could anyone tell me, where does windows store its default checkbox and radio images?
I've found some odd resources in ctl3d32.dll (these seem to be pre-win32), some in ctl32v2.dll (this even is not a valid PE ) and some in mfc42.dll. But 1st) i cant believe that non-mfc progs use this library, and 2nd) it hardly can believe that win produce grayed copies of these (for pressed-and-holding-buttons) on the fly.
The main purpose of this quest is creation of owner-drawn button, but I dont want to follow Davide Pizzolato's footsteps and include images as resources in built project like he did in his CxShadeButton.
Cryst
|
|
|
|
|
Here is my code :-
void CReportView::OnInitialUpdate()
{
Navigate2(_T("about:blank"),NULL,NULL);
IHTMLDocument2 *pDoc=(IHTMLDocument2 *)GetHtmlDocument();
if(!pDoc)
{
return;
}
HRESULT hr;
SAFEARRAY* psa = SafeArrayCreateVector(VT_VARIANT, 0, 1);
VARIANT *param;
MessageBox("L");
BSTR bsData = m_html.AllocSysString();
hr = SafeArrayAccessData(psa, (LPVOID*)¶m);
param->vt = VT_BSTR;
param->bstrVal = bsData;
hr = pDoc->write(psa);
hr = pDoc->close();
SysFreeString(bsData);
SafeArrayDestroy(psa);
}
You can see the MessageBox call there. If the MessageBox is there, it works right and shows the html rendering of the source contained in m_html which is a CString. If I remove the MessageBox, the html comes rightly for about 0.005 seconds [approximate guess] and then it becomes blank
Regards
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Okay, this is a sorta make-shift work-around
void CReportView::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
Navigate2(_T("about:blank"),NULL,NULL);
}
That's all
Now I have my own
void CReportView::RenderView()
{
...
...
}
This has sorta solved the issue. I call RenderView when I want to change the contents
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
An off topic question - how did you get your code snippet nicely formatted?
Gavin
|
|
|
|
|
|
Hai,
My class(eg.CMyView) is not looking in the class view. It is getting disapeared all of a sudden and I'm not able to get context sensitive help
also. This is happening to me frequently these days.
Ravi shankar
|
|
|
|
|
When this happens, close VC and delete project files *.aps, *.ncb, *.opt. Open project again - it should work properly.
|
|
|
|
|
Don't need to close the project and do those stuff, all you need to do are the following:
1, Use "file view" to open the header file of that "disappeared" class.
2, Intentionally produce at least one error in that header file, for example, type a few dummy characters somewhere. Build your project, and of course you'll get some compiler errors, good!
3, Clean the error(Remove those dummy characters you typed), rebuild your project again.
That's it. Now go to "class view" and you'll see that class appears again.
|
|
|
|
|
Hi
I want to create an explorer like application in that I want one more
pane at right side and if I select some items displayed in the second
pane and drag them into third pane I should be able to copy them into
some other location and I should see those dragged items in the third
plane.How can Ii chieve using MFC classes?
Please help me in this reagard or show me any code which is built
already in the form of dlls or whatsoever so that I can use it simply
in my application.
Thanks in advance,
regards
Pathi
Pathi
|
|
|
|
|
Hi.
You can use the Ole drag and drop.
It's a little tricky at first, but works fine.
You can find some example on this web site.
Search for Ole Drag and Drop.
Here's a tip.
Add the methos OnDragEnter(...) and OnDragOver(...), in your drop target, and add the following code in it:
return DROPEFFECT_COPY (or MOVE).
It took me 3 days to find that.
I hope this helps.
|
|
|
|
|
Hi,
I am using a CArrayRowset to populate rows in a virtual listview from a Jet 4.0 database.
As the user moves back and forth through the list the underlying CArrayRowset is left pointing to the furthest record loaded sequentially from the database.
My question is about updating data. The user selects an item in the listview which is different to the record currently pointed to by CArrayRowset, this item is cached in the CArrayRowset and so does not cause the record pointer to move.
To update this I need to be able to move the CArrayRowset's record pointer to the selected record and this is the bit I can't quite work out - I've looked at the CBookmark class briefly but it seems to me that in order to get a bookmark to the required row, I'd have to be on the row anyway which kinda defeats the whole purpose - maybe I'm misunderstanding the use of this class.
Can anyone help me with this one? I've done a quick search through deja but not found a great deal of information. This isn't the first time I've hit this issue with CArrayRowset, in the past I've avoided the problem by using a second rowset to edit the record, this worked OK because the listview contained lots of columns and a row displayed an editing dialog.
In this case, however, I want the editing to be inplace and using a second rowset seems a bit messy, especially when considering how to handle deletions.
Thanks for reading this message.
Regards,
Jason Wilden.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
Hi,
I am trying to write a small utility that allows users to customise the icon of my program, which is a precompiled EXE (similar in function to MicroAngelo etc, but much simpler, with only the option of choosing the new icon, which will then be applied to the EXE). I believe UpdateResource() can do this for NT (and the _UpdateResource class over at http://www.codeguru.com/misc/resources.html does pretty much the same for Win 9x). However, I can't figure out how to use UpdateResource correctly. I can't even get the sample code from MSDN to compile correctly.
Could anybody tell me how I can use BeginUpdateResource(), UpdateResource() and EndUpdateResource() to swap the icon in an EXE file for another .ico file (ie the end user will just have to select an .ico file)?
Many, many thanks to anybody who can help or give me any pointers.
All the best,
KB
|
|
|
|
|
How To Code a Meter To Track the Amount of Data Sent/ Recd from some Internet Connection
Manish Bhatia
|
|
|
|
|
Scenario :-
Main Dialog -> Child Dialog
[Means we have a main CDialog derived modal dialog, which brings up a second modal child dialog]
Child Dialog - CFrameWnd derived class F
[The child dialog creates and shows a CFrameWnd derived class F
in F's OnCreate() we do this :-
We create a CHtmlView derived class.
This is done calling CHtmlView::Create(...)
Now the problem is that Create fails and returns false
If I bring it up from the main dialog, it works.
It only fails when I bring it up from the 2nd dialog
Is there any way to figure out why and how Create is failing
This project is compiled with the /clr option by the way as it uses a good amount of managed code. Thus the debugging features are sorta mostly useless.
I created a test dialog app, added a child dialog and popped up a frame window with the CHtmlView derived view and made it a /clr app. That worked with no issues at all.
Do you guys think that with all the managed code, I am causing some kinda memory overflow or some other problem for MFC???
I feel miserable!
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
Guess what!!
I created and showed my frame window before all the managed stuff and now there are no problems. Weird eh?
of course this hasnt solved my issue. The last thing I want is to have the frame window jumping up before even the dialog is shown
Can someone throw some light on this pathetic darkness???
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Okay, so here's my rather ugly and stupid work-around.
Create my frame window in my OnInitDialog but turn off the visible bit in the flag.
Now whenever I want to bring up the framewindow with my custom view I do a ShowWindow with SW_SHOW
Of course now I have to override WM_CLOSE in the framewindow and instread of actually closin it I hide it
And I dont have to bother about a leak because the framewindoiw is destroyed when the dialog is closed because the framewindow's parent is set to the dialog CWnd
Cool, eh?
Regards
Nish
p.s. I know this sounds really silly and ugly, hey that rhymes, silly, ugly , well coming back to what I was saying, I dont have any other smarter ideas!!!
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
You may consider writing an article to share with us all this kind of tricks.
Best regards,
Alexandru Savescu
|
|
|
|
|
|
Hi,
How can i place the bitmaps in tab control header(without using MFC)?
thanks
Neha
|
|
|
|
|
Does one exist without #including <windows.h> and using Sleep()?
Sprudling
|
|
|
|
|
Sprudling wrote:
Does one exist without #including and using Sleep()?
Are you asking for a portable solution or what is your problem with using just Sleep()
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|