|
How about:
std::fstream file;
file.open("imi.asp");
if(!file.is_open())
{
cerr << "Unable to open file!\n";
exit(1);
}
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
You could also:
fstream infile;
infile.open("mystuff.dat", ios::in);
if(!infile)
cerr << "mystuff.dat couldn't be opened.\n";
-Nick Parker
|
|
|
|
|
Hello!!!
1.
How can I change the Font in a HeaderCtrl??
When I make it in a ListView like this:
CListCtrl * theCtrl = GetListCtrl ( );
CHeaderCtrl * theHeader = theCtrl->GetHeaderCtrl;
theHeader.SetFont(& font);
The Font is not right !!!
2.
The second Problem is that i want to have a CHeaderCtrl in a View . How can I do this??
I want to have it in a CEditView at the Top.
Thanx for helping me........
Dirk from Germany
|
|
|
|
|
schoni wrote:
The second Problem is that i want to have a CHeaderCtrl in a View . How can I do this??
Use a CListView.
|
|
|
|
|
Hello!!!
How can I change the Font in a HeaderCtrl??
When I make it in a ListView like this:
CListCtrl * theCtrl = GetListCtrl ( );
CHeaderCtrl * theHeader = theCtrl->GetHeaderCtrl;
theHeader.SetFont(& font);
The Font is not right !!!
The second Problem is that i want to have a CHeaderCtrl in a View . How can I do this??
I want to have it in a CEditView at the Top.
Thanx for helping me........
Dirk from Germany
|
|
|
|
|
For the font to be used, it has to be created correctly and be in existence the lifetime of the header control that will be using it. So make the font object part of your class, nt locally on the stack.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I'm having some problems here. What I want to do is access a sybase stored procedure through a c++ program. The problem I'm having is, 1) adding a data source to an already existing program. (I'm using Microsoft Visual Studio). 2) how to call the stored procedure and how to acess the results.
If anyone can give me any help it would be most appreciated.
ICXC
NIKA
|
|
|
|
|
http://www.codeproject.com/database/readdb.asp[^]
Update ur driver in the code to the sybase driver installed ( u can check it in the ODBC in control panel)
and use SQL like
EXEC storedProcedure ( or call , i dont recall exactly )
eg.
exec sp_FileExist 'F', 'CLNHLDY_DBF'
Hope this helps
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
You need to either use the Sybase CTlib directly or use a higher level abstraction layer, such as ODBC or ADO.
If using ODBC, you need the Sybase ODBC driver installed on the system and configured correctly. Once that is done, you can use SQLExecDirect or SQLPrepare/SQLExecute to invoke the SP. Remember that you either need to change to the appropriate database (using a CTLib function or SQL USE {database} query -OR- embed the database name in the procedure)
sprintf(caSQLBuf,"exec %s.dbo.MyProcedure '%s'", caDBName, caParam1);
SQLExecDirect(caSQLBuf).
Let me know if you need a generic ODBC class library or if you don't want to roll your own.
|
|
|
|
|
Can anyone think of a way to simulate the Jave concept of a 'package' access modifier (next to public, protected, private) in C++? For those who don't know Java: 'package' will give access to members for all classes that are in the same package, that would be in the same directory in Java; but what I would like to have is something that works like a namespace. Basically, to restrict access to classes and class members to othere classes that are in the same 'namespace'. In concreto, I have written a library with a public interface, and I want to disallow access to the internals of the library. It's an in-house library, but still, I would like to make sure that people don't start doing stuff without using the 'official' API. Thanks.
|
|
|
|
|
Hi,
I was happily editing my code today when I suddenly found that I had lost 30 classes! They no longer appear in the 'Workspace' area on the screen. If I look in the 'Files' tab the relevant files are there and the code compiles just fine. What the hell have I done????????
Any ideas of how I might get them to reappear would be brilliant.
Many thanks & completely confused,
Ali
|
|
|
|
|
It;s a common bug, only modify the header, and you will be the class in your workspece.
For example add an Enter in your header.....
Best Regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thank you, thank you, thank you
I've been adding and deleteing files for the last hour trying to sort it out. I obviously hadn't got the right file.
I took your advise and edited the headers, and bingo it is all there again. Phew, what a relief!
Thanks again,
Ali
|
|
|
|
|
Hi,
The .ncb file contains ClassView browser information.
I believe, some of your .ncb(if you're using multiple projects) file permission may have changed. That is the cause. To check that, create a sample program and change .ncb file to read-only. Now you reload the project, you will not be able to see any classes in the classview.
Hope this helps, if not better you move all your .ncb files to some other location. so that your .dsw/.dsp will recreate your class view again.
regards
~Hari~
|
|
|
|
|
Thanks for the help, I ran my project in the morning and they had all gone again, and when I looked closely not all of my classes had come back. But I tried deleting that file and they are all there now! Cheers!
Many Thanks,
Ali
|
|
|
|
|
For some strange reason, the temporay files .NCB, .CLW, and .APS need to be deleted every so often, letting VC++ rebuild them as necessary.
|
|
|
|
|
Thanks for the help, I ran my project in the morning and they had all gone again, and when I looked closely not all of my classes had come back. But I tried deleting those files and they are all there now! Cheers!
Many Thanks,
Ali
|
|
|
|
|
I'm creating many buttons dynamically using this to initialize it:
m_Icon[ndx].Create(_T(""), WS_CHILD WS_VISIBLE , CRect(0, 0, 0, 0), this,IDC_BTN );
Then later I'm adding in other information and then putting it on the screen:
m_Icon[0].SetTooltipText((LPCTSTR)ps1,true);
m_Icon[0].ActivateTooltip(true);
m_Icon[0].SetIcon(IDI_ICON1,NULL);
m_Icon[0].MoveWindow(iXpos ,(yscalestart + yscalediff*(profile.counter[0].iStationNum -10)),29,33,TRUE);
Any ideas on why the tool tip doesn't work?
I've used tool tips before using static items and it was never a problem
Thanks,
Jim
|
|
|
|
|
Hi,
You need to relayevent to the tooltip control.
Otherwise, how tooltip control will know when & where to show what?
Also, whether you are using CTooltipCtrl? If so,
then you have to add some more stuff also like addtool, etc..
regards
~Hari~
|
|
|
|
|
Thanks for the reply.
I'm using the CButtonST class that has the relay message in it. I've posted this to the Articles section...
|
|
|
|
|
I'd like to convert project file from visual c++.net to visual c++ 6.0
What should I do ?
Thank you in advanced
|
|
|
|
|
|
|
hi,
is the someone who knows the actual version of the mscomm32.ocx control?
where can i search for a new release?
i have problems with the parity option. after an undefined time of work the control sends only the parity replace char to my software. when i close and start the port again the problem is cleared until it occurs again. this problem happens mainly on laptops. i checked the correct bit stream with an oscilloscope. the bit stream is at any time correct. did you recognize the same problem?
Dr-Kuulun
|
|
|
|
|
In Windows Explorer, right-click on the file and select Properties. You can then see what the version is.
|
|
|
|