|
If you have BMP files, you may use LoadImage() to load the bitmaps from file.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Im sorry that i have to make a new tread about my problem but i spent 25 Hours trying to pass a parameter to this stored Procedure in C++:
Alter Procedure URBAN
As
Declare @pkMbtID varchar(50)
INSERT INTO MBT
(pkMbtID, MbtType)
Values (@pkMbtID, '122')
return
I have tried with both CreateParameter and Refresh Method, but i only the error 0xE06D7363. I read about this and tried to do what microsoft say about this, but it aint working
But after a long thought i realized that the stored Procedure cant be stored in the database. I must have the stored procedure in the ATL ADO COM object, anyone here who can give me an example of this before i spend another 25 Hours on something that can be solved easy.
I be very grateful for tips!
|
|
|
|
|
What db are you trying to use? What do you mean the stored proc can't be stored in the database? And why did it take you 25 hours to figure this out?
Another questions is why you are using ADO with C++, OLE DB would be a better choice. IMHO.
Have you tried using a command string to send everything directly?
|
|
|
|
|
If i want to change the Stored Procedures i have to change in the database, its a MSDE database.
I cant change there because the laptop ain't having any administration tools to the MSDE database. So if i want to change the database interface i just produce a new dll file.
OLE DB
I started with this and after a couple of weeks i gave up. To code there aint easy accessing multiple tabels etc... ADO is one level upp making it easy with stored procedures.
A question have you done any advanced application in OLE DB?
I even mailed Len Holgate about my problem with OLE DB and he said:
"I think some of these problems are so hard to solve that when people do
manage to solve them they want to get away from them as quickly as
possible..."
So now i made a stored Procedure inside the ADO code but the error
Unhandled exceptio in CH03.exe(KERNEL32.DLL): 0xE06D7363
is coming up.
Thanks for the tip anyway but i really hate OLE DB coding with ATL
|
|
|
|
|
There was another discussion comparing ADO and OLE DB. In general if you are using C++ ADO is not the best choice, OLE DB gets better performance and less overhead.
Have I done any advanced application in OLE DB?
Yes. The last one was ATL based that used OLE DB to connect to a DB2 database and drive a website using Netscape iPlanet. It used stored procedures, XML formating, updates, insertions, refreshing. How's that?
The only problems I had were that the staff (I was consulting) had absolutly no knowledge of DB2, stored procedures, or Netscape. Talk about a challenge. Idiots spent thousands on software they didn't even know how to use when they had NT with IIS and Oracle.
Doing OLE DB with ATL is much better than trying it raw. If I'm using C++, ADO doesn't even enter my mind.
To each his/her own.
|
|
|
|
|
OK, as you have notice im a beginner at this.
How should i store the stored procedure in the ATL Com object?
Maybe you could send me some cod for this or a link.
I will describe my Problem her again so that is no missunderstanding:
I have this Stored Procedures:
Alter Procedure URBAN
As
Declare @Name varchar(50)
INSERT INTO MBT
(Name, MbtType)
Values (@pkMbtID, '122')
return
I want a COM object(dll file) that produce a function who i can put the parameter @Name in.
Another C++ application vill call this dll file and choose a function(ther vill be about 10 diffrent stored Procedures and 10 diffrent funtions in the dll file)
Thanks alot
|
|
|
|
|
Set the command text with your stored proc and execute. How much more difficult does it get?
ICommandText::SetCommandText
|
|
|
|
|
If you pass the query as a string (which is what I was telling you before in your other post), you don't have to have 10 different functions, only one function. And you can pass a SQL string or an EXECUTE command.
Are you actually trying to solve your problem, or do you just want to solve it your way?
CodeGuy
The WTL newsgroup: 880 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|
|
We use VC6++ SP5 with Sourcesafe 5 here... every time i load a SS checked in/out project in VC, I have to login to sourcesafe... Really annoying..
There must be a simple dumbass way to get round this???
HELP ITS THE LITTLE THINGS THAT DRIVE ME INSANE!!!!!!!!
Tim Stubbs
|
|
|
|
|
I agree that source safe is a pain, but of COURSE you need to log in to source safe, because it needs to be ready to check in/out code. In the world of W98 ( where you don't need to log in to start an OS ), logging in everything makes the code on source safe secure.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm in Win2k, therefore i consider that *reasonably* secure (in that i have to log in). I agree, you *should* login to srcsafe - but... why do i have to do it all bloody day long I mean, I load a project, therefore i login, VC falls over, I load a project, therefore i login, I load another project, therefore I login... Ad Infinitum. The force is weak in this one...
Seriously, there is something wrong if SS can't work out you're logged in thru one devstudio, and therefore don't need to do it all over again when you load a new devstudio instance on the same machine... I mean, user/pw for SS is per user, not per project. Some days I just wanna scream, go postal and 'liberate' the office
Tim Stubbs
|
|
|
|
|
Well, wait until you get code rollback courtesy of SS - that's REAL fun.
However - your VC falls over under W2000 ? What's going on ? I've NEVER had VC crash in W2000.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Oh yeah VC falls over nicely.... I think it's related to the fun and games from a known bug when you've got norton antivirus installed - often i get a 'file in use' error when trying to save a file, which then mysteriously evaporates.
When VC crashes, it's usually when i hit alt f, l (save all) - the editor locks up for a second or two and then 4/5 times it dies. Same problemo when i hit f7 (less frequent) as i have 'save all files before compiling' checked in the opts.
Then again, I've been using VC since it's 4.1(?) incarnation and it's never been anywhere near bug free...
Tim Stubbs
|
|
|
|
|
In the Visual SourceSafe Administrator 6.0 there is an option "Use network name for automatic login" in Tools, Options, General. Don't know about 5.0 though.
Anyway, in 6.0 it works great, I'm on Win2k and NEVER need to log in to SourceSafe.
Sito Dekker
|
|
|
|
|
Create environment variable SSUSER (this is loging) and SSPASSWORD, or SSPASS (or something like that).
No more login dialogs.
|
|
|
|
|
Chaps,
Am using an ownerdraw VIRTUAL list control (an example of this can be found at codeproject in an earlier program I wrote-the hextext control). How do I set the HEIGHT of an item in CListCtrl? I am not using any image lists/bmps or the sort at all...totall owner drawn, I do my drawing in OnDrawItem. I am passed a DRAWITEMSTRUCT pointer that contains the bounding rect, hdc, etc...that I need. Problem is, I want to set the item HEIGHT. In other words, I need a way to alter the bounding rect-before I get it in the OnDrawItem. Icons/imagelists are out, as I am usign the virtual style. Each item is completely under my control-I am responsible for rendering it.
Any suggestions would be very much appreciated.
"When it's done." - 3D Realms.
|
|
|
|
|
I think you have to handle the WM_MEASUREITEM message, but the height you set will affect all the rows, because the ListView control uses a LVS_OWNERDRAWFIXED style (fixed height).
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
I to all,
I have a big problem with a CWinThread derived class.
From another class I post messages to this derived class with PostThreadMessage(...) member function, and if I store all messages in a log file I can see all them.
On the derived class, if I store to a log file all messages that I receive, I can't see all them!
So it seems that my derived class is missing some messages!
Is this possible?
help me please.
Thanks in advance.
|
|
|
|
|
This one gave me grief when Win2K came out. Check out the KB, and you will see it is a "feature". You need to create a HiddenWindow and send the messages there.
http://support.microsoft.com/support/kb/articles/Q183/1/16.ASP
Shane
|
|
|
|
|
Thanks a lot Shane, but I've solved my problem simply adding a sleep statement of 100 ms after the PostThreadMessage(...) !
I don't know why, but now it works fine.....
Thanks
Massimo
"Take time to think, it is the source of power"
|
|
|
|
|
Be very careful with this solution, what works for you may not work for those with Dual CPUs.
Shane
|
|
|
|
|
Thanks in advance.
"Take time to think, it is the source of power"
|
|
|
|
|
I want to write driver that will behave like printer but will send data on remote machine to another program that will print it on physical printer.It is for Windows. Chiefly how to let the first driver to receive data ??? Thanks in advance.
Celebrate Mr. Cesilko!
|
|
|
|
|
i would like to create new file(excluding special characters) after read existing file.
by the way, error occur if read excess of 2M over file.
see following source and tell me answer
thank you
/////////////////////////////////////////////////////////////////////////////////////////////
CTestView::OnOpenFile()
{
CFileDialog Dlg(TRUE, "TXT", "*.TXT", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"text file(*.TXT) | *.TXT|");
if(Dlg.DoModal() == IDOK)
{
CFile fp, fp1;
int i, j=0;
TCHAR chr, chr1;
UINT size;
char *buff, *temp;
long filepoint = 0;
fp.Open(Dlg.GetPathName(), CFile::modeRead);
fp1.Open("tanslater.txt", CFile::modeCreate | CFile::modeWrite);
size = fp.GetLength();
buff = new char[size];
temp = new char[size];
fp.ReadHuge(buff, size);
// CString m_data -> To be used in OnDraw()
m_data = buff;
for(i = 0; i < size; i++)
{
chr = m_data.GetAt(i);
chr1 = m_data.GetAt(i+1);
if(chr == 0xa2 && chr1 == 0xc4)
{
filepoint += 2;
}
temp[j++] = buff[filepoint++];
}
fp1.WriteHuge(temp, size);
Invalidate();
delete buff;
delete temp;
fp.Close();
fp1.Close();
}
}
have a nice day
|
|
|
|
|
a: i'd like to know what's the difference between vb and vcpp. with what is it better to start learing programing?
b: how is the Microsoft press's books as tutorials? r they good?
c: i got the vs 6. enterprise edition, is it worth something? ;)
joker
|
|
|
|