|
After opening the Recordset object using open(), when I write this if statement
if(!rs.IsBOF())
{
DisplayMsg(" if block entered");
rs.MoveFirst();
}
this if block is not entered which means that Recordset object is at beginning of file. Does it mean that Recordset is empty? While when I checked the Recordset object using
short nFields = rs.GetODBCFieldCount( );
it returned 1.
but after it while loop is not entered at all as I have mentioned in my previous posts.
Cyber Friend
|
|
|
|
|
Hi,
Sorry to u all as there was no problem in the code which I posted in my question. Actually I have the two copies of the database which I am working on and mistakenly modified the copy of the original database while I had to modify original one bcoz I was querying the original database. The values I was seeking were not in the original database which I was accessing through my application bcoz of that Recordset object was empty.
Sorry again.
Regards
Cyber Friend
|
|
|
|
|
Cyber Friend wrote: Does it mean that Recordset is empty?
Possibly.
Cyber Friend wrote: While when I checked the Recordset object using
short nFields = rs.GetODBCFieldCount( );
it returned 1.
Columns (fields) are not the same thing as rows. A table typicaly has several columns, but could easily be empty (no rows) if no data has been entered.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I have a dialog application that opens a series of windows. I have been using ShowWindow(SW_HIDE) to hide each when opening the next. However, I am having problems now, I want to go back to the main window after opening (and hiding) all of these windows. But even when it is the only one not hidden, I cannot click on it once something else has been opened. Is this because I need my windows to be modeless? or am I able to distroy them somehow after opening them instead of using ShowWindow(SW_HIDE)because that seems more practical? Sorry for the stupid question, but this is my first MFC program and I will catch on eventually
-Brandy
|
|
|
|
|
aei_totten wrote: Is this because I need my windows to be modeless?
Yes. If the dialogs are modal, you'll only be able to interact with one of them at a time.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
So then, do I need to make every single window (besides the base) modeless?
|
|
|
|
|
Yes, if you want to be able to access the main dialog. With a modal dialog, since it has its own message pump, you'll need to dismiss it before any other of the application can be started. See here for more.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I have this file
DET.TLB Its a type library
But, when I use it I get the error
Retrieving the COM class factory for component with CLSID {B65AD803-ABAF-11D0-BB8B-00A0C90F2744} failed due to the following error: 80040154.
SO basically this class is not registered or I don't have permissions to use it.
So, I thought maybe if I create a dll from the tlb file, I could then use it.
So does someone know how to do that?
I gave users full permissions and it still doesnt work, so does anyone know how to create a dll from that tlb?
Thanks,
nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: So, I thought maybe if I create a dll from the tlb file, I could then use it.
im not that much familiar with COM but I think just opposite is always happen that we are create TLB file from dll and also as off my knowledge we coould not register a TLB file
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
The RegisterTypeLib(...) function can be used to register Type Library information (as well as a newer function that I cannot remember off the top of my head) - you can write a little app to use it.
However, it sounds like your problem is that the underlying COM object(s) DLL is not registered. I would start with finding that DLL and running RegSvr32 on it.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Ista wrote: DET.TLB Its a type library
But, when I use it I get the error
Use it? How?
A .tlb file contains a description of interfaces and other types defined in a .idl or .odl file that is compiled with the MIDL compiler.
The typelibrary (the .tlb file) could be included in the distributable binary, e.g. an ActiveX control, as a resource; or it could be distributed as stand alone file.
Either way it's tightly connected to the binary that it describes.
Ista wrote: I thought maybe if I create a dll from the tlb file, I could then use it
Think of the type library as a header file. When you've had that thought I assume you realize that you cannot compile a header file and build an executable application of it.
We "use" the type library when we add a library to the project, it could be a DLL, a COM server, an ActiveX control etc.
What happens here is that somewhere ::CoCreateInstance() is called and asked to create an object that has not been registered, at least not yet.
The cure for this is naturally to register the object/server.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Well what Im trying to, is Open a file ( classic asp ) and go to a specific line number. This is all done in InterDev.
Opening the file is easy "devenv.exe filename.asp"
But I need to go directly to a specific line number. So I thought I could link the library and Just use the COM to open the file and use the GoTo method to do my work.
So, in the VS2005, I create the reference. IThe environment creates the wrapper DTEClass(). ( file DTE.tlb in your IDE folder )
I instantiate it and but, I get this class not registered type error.
Do you have any ideas?
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
In what way are these questions related to the forum topics: VC++ and MFC?
I don't know anything about InterDev, which I suspect is crucial to be able to help you.
Regarding COM the simple fact remains: the server you're trying to use, one way or the other, has not been registered hence you cannot use it.
Whether this is something that gets installed together with InterDev or not I cannot tell you.
Have a look in the registry under the HKCR\CLSID and if you cannot find the key
{3C9CFE1E-389F-4118-9FAD-365385190329} the DTE server has not been registered.
This is the class id of the DTE for VC7 that I've found in the typelib Dte.olb.
You can also use OLE/COM Viewer to lookup interfaces/typelibs/servers that are registered.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Well. I just wanted to use the COM to open it up. I got it to work with versions 7.0, 7.1, 8.0.
I used the OLE viewer to find it, but it's no where to be found.
Maybe its not publicly creatable or something.
So I give up. I can open it, and just use SendInput to manipulate it.
Thanks, for helping tho. I've been doing .NET for so long, I forgot most of the COM rules.
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I've had the same problem. I just wrote a wrapper in VB6 and used that dll instead.
If you really hate VB (like I do ) you can look into the
Interaction class which is able to call CreateObject and CallByName functions. I found this not so easy, but in my test case it worked fine except for the calls where a parameter was passed by value. (That's why in the end I resulted in VB6)
Hope this helps.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee> ![Jig | [Dance]](https://codeproject.freetls.fastly.net/script/Forums/Images/jig.gif)
|
|
|
|
|
Yeah. I absolutely hate VB! lol
SO I used The Interaction namespace to use create object. That works fine.
But, I just dont know the Prog ID for VisualInterdev.
I'm trying to automate some tasks, so I dont have to look at VB or classic asp more than I have to. It's like the plague to me.
If you know the prog ID, your my hero. I searched with every tool imagineable and no luck
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
It's somewhere in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Classes
You could do a look on the filename (without extension)
if OK you should have a Default string with a name and an AppID key with a GUID.
(eg. If your file is called yourname.tlb do a search on yourname under HKEY_LOCAL_MACHINE\SOFTWARE\Classes. Hopefully it will come up).
I didn't found how it linked with the tlb file though.
Good luck.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
-- modified at 14:59 Wednesday 31st May, 2006
|
|
|
|
|
yeah. I tried by class id.
Thanks for helping
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hi.
In the debug window of VS, when I run the project, cames a string like this:
Ecception first-chance at 0x066d4931 in MyProg.exe: 0xC000001D: Illegal Instruction
(Together with the lines that tells that the DBG files are not founded)
But it is not linked to any line of my code!
Is there a way to find correct this warning?
Thanks.
Cheers,
Russell
|
|
|
|
|
|
mmm....
It is displayed 1 seconds before that the main window is displayed.
At that point of the execution I haven't used any pointer , I think.
Thanks anyway
Cheers,
Russell
|
|
|
|
|
You can use your debugger to narrow the problem. The call stack is also very usefull to find which of your function caused the crash.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
sigh: sigh:
It cames when
CvtkInteractor::Initialize()
Probally a bad dll of the VTK toolkit
Cheers,
Russell
|
|
|
|
|
I tried all what possible in VC++ , or windows to find device context
I want to start thread for engine simulation. but I have to pass the dc to my
function because it is generic class and not from mfc. what to do in this case.
or please let me know how to get view window from the generic class.
here is my code.
UINT CMy5CYLINDERView::ThreadFunc(LPVOID pParam)
{
CWnd *cwnd,*cwnd1;
cwnd1 = cwnd->GetWindow(1);
CDC* pDC = cwnd1->GetDC();
simulate* eng = (simulate*)pParam;
eng->nextpos(pDC); // program compiles on run gives access violation.
return 0;
}
void CMy5CYLINDERView::support()
{
FireCylinder();
for(int ii = 0;ii <= 3;ii++)
{
x[ii] = AfxBeginThread(ThreadFunc,(LPVOID)&engine[ii]);
}
}
|| ART OF LIVING ||
|
|
|
|
|
i think your problem is cwnd1 = cwnd->GetWindow(1); whats value cwnd(CWnd *cwnd)
whitesky
|
|
|
|