|
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
|
|
|
|
|
I don't see any info on PostMesage in the MSDN, where can I find some info on that?
(edit - nevermind I found the page in the msdn)
|
|
|
|
|
sorry, right function name is : PostMessage (return at once) or SendMessage (return after executing).
includeh10
|
|
|
|
|
I'm afraid you're out of luck. This control is not a standard edit box and seems not to be using the "caption" as the displayed message (which is how edit boxes behave). Maybe there's some custom message than can be used to set this control's content, but unless you've got additional info this is like looking for a needle in a haystack.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yea, that is kinda what I was thinking too. but there has to be a away, I must be able to make the computer do as I wish, hehe. So I guess I email the programmers of the program and see if they will help me any.
Thanks for all your help, and if any more information about this can help me, please let me know.
Quinn
|
|
|
|
|
Hey everyone. I'm trying to get the CInternetSession class do asynchronous fetching of web pages and I'm having some troubles. I have my class derived from CInternetSession (cleverly named "IgnorantInetSession" since it should essentially ignore results) and I keep getting assertion errors when the object is initialized. The class declaration is:
class CIgnorantInetSession : public CInternetSession
{
public:
CIgnorantInetSession(LPCTSTR pstrAgent = NULL,
DWORD dwContext = 1,
DWORD dwAccessType = PRE_CONFIG_INTERNET_ACCESS,
LPCTSTR pstrProxyName = NULL,
LPCTSTR pstrProxyBypass = NULL,
DWORD dwFlags = 0);
virtual ~CIgnorantInetSession();
void CIgnorantInetSession::OnStatusCallback(DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength);
};
In the constructor, I call EnableStatusCallback(TRUE); - this throws the asssertion problem. The function implementing the callback looks like so:
void CIgnorantInetSession::OnStatusCallback(DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength)
{
CInternetSession::OnStatusCallback(dwContext, dwInternetStatus,
lpvStatusInformation, dwStatusInformationLength);
}
Does anyone know what's going on here? Thanks!
Luke Reeves (LukeyBoy)
luke@oceanlake.com
|
|
|
|
|
Accoring to MSDN, to handle any operations asynchronously, three conditions must be set: - In the constructor, dwFlags must include
INTERNET_FLAG_ASYNC .
- In the constructor,
dwContext must be set to one.
- You must establish a call back function by calling
EnableStatusCall() . /ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Yeah, I do exactly that. The call to the constructor is:
CIgnorantInetSession session(0, 1, PRE_CONFIG_INTERNET_ACCESS, 0, 0, INTERNET_FLAG_ASYNC);
session.EnableStatusCallback(TRUE);
It should work just fine, but it still doesn't.
|
|
|
|
|
Where does it assert?
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|