|
ah.
any idea what the extra '4' represents?
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
WS_CLIPSIBLINGS (WINUSER.h)
A strange style to be misbehaving
I have a feeling that this bug-hunt is academic now anyway, as I modified the resource to have ClipSiblings set, and it still does not work.
So even if I could get that ModifyStyle() call to do the job, it would not solve my problem.
Intriguing though....
Thanks,
Pete
|
|
|
|
|
So, for those who are interested, here is how I did it (finally):
ModifyStyle() can't be used, possibly because of the way dialogs are loaded from resources.
But it is possible to programmatically modify the resource, as follows:
CString strIDD;
strIDD.Format( "#%u", IDD_VCR );
DLGTEMPLATEEX* pDlgTemplate = (DLGTEMPLATEEX*)::LockResource( ::LoadResource( NULL, ::FindResource( NULL, strIDD, RT_DIALOG ) ) );
pDlgTemplate->Style = 0x40000844;
m_pVCR = new DEmbeddedVCR();
m_pVCR->CreateIndirect( pDlgTemplate, this );
This should all really be put in DEmbeddedVCR::Create(), rather than called 'client-side' as it were.
Hope that helps out someone at some point...
Pete
|
|
|
|
|
I am doing a simple select distince:
if(pAdoDb.Open((LPCTSTR)strConnection))
{
CString strCommandText;
CString strQry = _T("");
int numRecords;
strQry.Format(_T("SELECT DISTINCT (Color) From tblTest"));
CADOCommand pCommand(&pAdoDb, strCommandText = _T(""),CADOCommand::typeCmdText);
pCommand.SetText(strQry);
CADORecordset pRs(&pAdoDb);
if(!pRs.Execute(&pCommand))
AfxMessageBox("failed");
This snippet worked with "select * from tblTest".
With the distinct command above I am getting a runtime error:
CADORecordSet error
code = 80040e10
code meaning = IDispatch error #3088
Source = Microsoft JET database engine
Description = No value given for one or more required parameters
What am I doing wrong? Please help!
Thanks,
ns
|
|
|
|
|
Are the parentheses around "Color" extraneous?
(Caveat: I know nothing about SQL.)
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
The parentheses dont seem to matter. I just realized this is not the forum for this stuff, but the ADO forum is really dead....d'you think I can post here or is that not nice?
|
|
|
|
|
ns wrote:
The parentheses dont seem to matter.
Ugh, sorry. I got that from Google.
It's probably better to post in the ADO forum, but I think the lack of replies isn't due to the forum location, rather that most readers may not know the answer. I wish I could help, but I'm database clueless.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I am not so sure about ADO but right off the bat, the number of columns you are returning has changed. Have you bound columns?
|
|
|
|
|
Firstly, I think the parentheses are not really needed. Secondly, make sure you're using the right combination of uppercase and lowercase letters.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I blush to mention this but I had two copies of the database and I had added columns to one, which I was querying on, but I hadnt pointed my connection to the right version... Anyways I found out what SQL does when it doesnt find a column with the name you specify. Ulp!
|
|
|
|
|
Hi,
I have two interfaces, say IOne and ITwo:
__interface IOne;
__interface ITwo;
[
attribute stuff
]
__interface IOne
{
HRESULT Two(ITwo *pTwo);
};
[
more stuff
]
__interface ITwo
{
HRESULT One(IOne *pOne);
};
The C++ code compiles, but the MIDL fails saying the ITwo parameter in the IOne interface is unresolved. I have tried alsorts of attributes and hacks to get it working and it has me stumped. I have looked through MSDN and found nothing.
Any ideas?
Thanks.
|
|
|
|
|
The code seems just fine. I'm almost sure this won't remedy the problem, but please try replacing __interface with interface . Also, the forward declaration of IOne is not needed, maybe you can try deleting it to rule out the (remote) possibility that the compiler is getting confused by it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
The IOne/ITwo were just a simplification, it's an object model for an offline physics simulator so there's quite MIDL forward declarations to worry about.
changine __interface to interface causes the code to not compile at all. I have changed the forward declarations to everything I can think of. I have even tried dumping a list of my objects in a separate .IDL file and inserting/including it using an embedded IDL statement. Nothing's working.
I would have thought that Microsoft, with 7.0's attributes, which are designed for simpler and speedier COM/ATL/.net programming, wouldn't require forward declaration when it gets to the post-C++ compilation stage.
|
|
|
|
|
I have an ATL DialogBox class with a ListView Control. I'd like to set the sizes of the columns dynamically. However, when I try to pass the width, I get an "Invalid Property Value" error:
CComPtr<MSCOMCTL::IListView> piAnsList;
HRESULT hr = GetDlgControl(IDC_ANSWERS,__uuidof(MSCOMCTL::IListView),
reinterpret_cast<void**>(&piAnsList));
CComQIPtr<MSCOMCTL::IColumnHeaders> piColHdrs;
CComQIPtr<MSCOMCTL::IColumnHeader> piNewHdr;
piColHdrs = piAnsList->ColumnHeaders;
_variant_t vColKey(L"ColOne");
_variant_t vColName(L"First");
_variant_t vWidth((double)100.0);
_variant_t vAlign((long)MSCOMCTL::lvwColumnLeft);
piNewHdr = piColHdrs->Add(&vtMissing, &vColKey, &vColName,
&vWidth, &vAlign);
If I replace vWidth with vtMissing, everything is fine, so it must be the width. I got a similar error using the IColumnHeader->PutWidth method. Any suggestions greatly appreciated. Thanks.
Russ Rogers
GraniteLeaf Systems
|
|
|
|
|
in NT, we can use CreateFile("c:\\Myfolder") to open a folder handle then do something with it (i.e. monitor it), it is very useful.
do u know is there a similar way for win9x?
thx.
includeh10
|
|
|
|
|
I want to get the names of all the field in the database. How do I do this?
Also, when the rs is returned, and it contains say 7 records, can I ask for record #5? How do I do this? I need to access the records by the index they hold in the returned recordset (0-6). Is there a natural indexing that is available to me?
Thanks,
ns
|
|
|
|
|
Depending on what you are using, (SQL Query vs. Stored proc), GetRowsFetched() usually returns the number of rows fetched (presuming you are using Bulk Row fetching).
GetODBCFieldCount() gets the number of fields (columns).
GetODBCFieldInfo() gets the field info into a CODBCFieldInfo structure.
SetRowsetCursorPosition(DWORD row) will set the position to a specific row.
ashish
|
|
|
|
|
Great> fieldInfo has embedded in it what I need. Many thanks!
ns
|
|
|
|
|
I have a problem:
I am trying to use stored procedures that return rows of data but not as output parameters.
When I execute the simplest of these with CRecordset derived class, I get a return status of -1 (which is what return_status is set to originally).
Is there any way to get the data returned by a stored proc without using output parms? I am using a CRecordset derived class.
Thanks
ashish
|
|
|
|
|
I am trying to interface with another application and I want to add text to a edit box in it. I have the HWND for the window but I can't figure out how to get text to show in the box.
I have tried to use WM_SETTEXT, but that isn't working. Is there another way I should be looking for to do this? Thanks.
Quinn
|
|
|
|
|
Is the HWND you've got the handle of the editbox, or of its parent?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have both the handle to the parent and the handle to the control. I use FindWindow to get the parent and FindWindowEx to get the control HWND.
|
|
|
|
|
Ummm... it should work. Things you can do to locate the problem:- Make sure you spotted the right parent window by sending the
WM_SETTEXT message to it --the window caption should change accordingly.
- Make sure the handle actually belongs to the edit box using Spy++, a little utility that comes with VC++ and is able to inspect the internals of currently active windows.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have been using SPY++, but thanks for suggesting it. That's how I made sure I had the rigth window. One of the things I've noticed with some testing is that this is a subclassed control. Also with SPY++ I can see that the control has a 'caption' to it that says 'trillian display' and when I use the WM_SETTEXT to the control it will change that value. But nothing shows anywhere. SPY++ also showz that the control class is 'trillian display'
Does that help narrow down the possibilities any?
|
|
|
|
|
i used something similar to u before, but not WM_SETTEXT.
i had HWND of a window in another app, i used PostMessge to send a set of command (different numbers) for communicating between the 2 apps.
i suggest u try PoseMessage(hwnd_Peer, WM_USER+???,a_number,0) first to see if another app can receive the message with a number, it should be OK.
i only suspect u can't send a string from one app to another, but not sure, because COM can't send a string in this way vs its method.
includeh10
|
|
|
|