|
Mazdak wrote:
43
No, 42! It could also be three, seven or 4711, but never 43.
Btw, who was "Stale Laney"? The answer to OP's post would probably be "we all die, that's the only thing that's absolute", possibly with the addition "that's the only thing we humans have to look forward to".
|
|
|
|
|
The singer from Alice in Chains. As a person from a generation earlier, I'm of the opinion he's one of the people who *destroyed* rock music. It's still a shame he died so young though.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
The singer from Alice in Chains. As a person from a generation earlier, I'm of the opinion he's one of the people who *destroyed* rock music.
OK, then he's probably a generation or two after me (and you'd be, like, 10 years now Christian? ).
If he destroyed rock music, I'd love to know why e.g AC/DC, Sabbath, Manowar ... are still on my playlists when I go into "serious hacker" mode. That's not destroyed and never will be!
|
|
|
|
|
Mike Nordell wrote:
If he destroyed rock music, I'd love to know why e.g AC/DC, Sabbath, Manowar ... are still on my playlists when I go into "serious hacker" mode. That's not destroyed and never will be!
You and I may be waving the flag, but while ACDC & Sabbath can still fill stadiums, the same is not true of most bands from those eras.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
He didn't 'have' to die. He died because he was an idiot. I like to think of it as natural selection.
|
|
|
|
|
LOL
Michael
|
|
|
|
|
friends
i created a Member object of Dialog class and
use the memberobject.Create(resourceID,parentWindow);
to create that ..
It work as fine in the DEBUG
but not in release ..Any idea????
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
Check the optimizations in the project options .
|
|
|
|
|
everything is ok on that part...
i think there is some memory issues...
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
What about creating a new Forum for Managed C++?
Al
|
|
|
|
|
Albert Pascual wrote:
What about creating a new Forum for Managed C++?
I'm still using VC++ 6 and haven't gotten a chance to check out the new .NET development environment. What're the differences between VC++ 6 and Managed C++? Is it a new derivative of the language, or just a new IDE?
-Mike Zinni
Software Engineer
email: mzinni@rimail.com
AIM: zin9999
|
|
|
|
|
This question best answered by somebody at Microsoft like Nick Hodapp.
But in my modest opinion MC++ is like C# but better as you can add managed and unmanaged code (without P/Invoke)
It's more than C++ with a gargabe collection, has the same classes than C# and as flexible as C++
Cheers
Al;P
|
|
|
|
|
Why not just post your questions here for now? There haven't been too many MC++ questions in the past. If enough people do so, it might make sense for Chris to create a new forum.
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
I thought that if we had a C# forum we should also have one for MC++.
Al
|
|
|
|
|
Albert Pascual wrote:
I thought that if we had a C# forum we should also have one for MC++.
There is no VB.NET forum though.
[dodges flaming arrows]
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
I agree. MC++ and C-hash has nothing to do with C++ (even that this forum is really Visual C++ which isn't C++ by a longshot).
|
|
|
|
|
Hi,
I'm trying to create dsn's programatically for an installation I'm doing. When I create them either by setting the registry setting (ID: Q184608) or calling the following:
<br />
#include "stdafx.h"<br />
<br />
#include "stdio.h"<br />
#include "windows.h"<br />
#include "sql.h"<br />
#include "odbcinst.h"<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
RETCODE retcode;<br />
<br />
retcode = SQLConfigDataSource(NULL,<br />
ODBC_ADD_DSN,<br />
"SQL Server",<br />
"DSN=MY_TEST\0"<br />
"LastUser=test_user\0"<br />
"Database=test_database\0"<br />
"Driver=C:\\WINNT\\System32\\sqlsrv32.dll\0"<br />
"Server=test_server\0\0");<br />
<br />
return 0;<br />
}<br />
The DSN doesn't show up in the ODBC Data Source Administrator. I even exported the settings from the registry to make sure everything was being set correctly.
Can anyone point me in the right direction as to why they don't show up?
Thanks in advance,
Craig
|
|
|
|
|
Hi Guys I an trying to read in a binary file to a variable called buffer.
See code below
buffer is defined as char *
but when I debug code, buffer only seems to hold the first character from the file.
What I am trying to achieve is to read in the file search it for a particular string and when I find
this string, read in the entry in the file which is x characters after the first found string
I know 'seekg' can read in characters from a given position.... but firstly I have to find the position
of a particular string in the file.
The file is an SQL Server Profiler trace file.
Is there some other way I can do this - Is there any way I can serach the file without reading it in...
or do I need to declare buffer in a different way.
Any ideas would be appreciated
Cheers
=====================================================
// readbinaryfile.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <fstream.h>
#include <string.h>
const char * filename = "C:\TenforeFeed.trc";
char * buffer;
long size;
char * pch;
int main(int argc, char* argv[])
{
ifstream file (filename, ios::in|ios::binary|ios::ate);
if(file.is_open())
{
size = file.tellg();
file.seekg (0, ios::beg);
buffer = new char [size];
file.read (buffer, size);
cout << buffer[3];
//delete[] buffer;
}
return 0;
}
========================================================
|
|
|
|
|
I'm assuming, the value returned by tellg is the correct value. If so, try it with a file you construct using Notepad. If the file contains UNICODE data, typically, every other byte is 0. This causes the string to look like it is only one character long.
Hope this helps,
Bill
|
|
|
|
|
Use wchar_t instead of char
|
|
|
|
|
Hi guys,
All the code that I have ever written has been for the standard english version of windows. Recently, though, my company has been talking about sending our software overseas to some of our partners. The people that will be using it will speak english so I won't have to get menus, titlebars and things like that translated. BUT I know that they will connecting to databases that use different character sets. (I don't have access to a nonenglish version of Windows or SQL server yet.) Can you guys give me some tips on using Unicode or anything that I should look out for.
I guess I'm wondering about things like when to use TCHAR, _T() and if CString holds up inplace or do I have to rewrite things. Any tips or things to watch out for would be greatly appreciated.
Here is some code that I'm thinking of using it would connect to a db and bring back a list of tables from a combobox selected database will it work for double byte unicode?
----------------------------------------------------
//Get the User selected db from the combobox
CString db = _T("");
m_cmbDatabases.GetLBText(m_cmbDatabases.GetCurSel(),db);
//Open a new conncetion to the User selected db
//m_Server,m_LoginName,m_Password are CStrings returned from a dlg
CString strConnection = _T("");
strConnection.Format("driver={SQL Server};server=%s;uid=%s;pwd=%s;database=%s",m_Server,m_LoginName,m_Password,db);
if(DB.Open(strConnection))
{
//Update m_lstTables
CString Tablename = _T("");
RS = CERecordset(&DB);
if(RS.Open("SELECT name FROM sysobjects WHERE type = 'U' order by name"))
{
m_lstTables.ResetContent();
while(!RS.EOF())
{
RS.GetField("name",Tablename);
m_lstTables.AddString(Tablename);
----------------------------------------------------
|
|
|
|
|
You should use _T() for any literal strings in your source.
So, the Format() call should be:
strConnection.Format(_T("driver={SQL Server};server=%s;uid=%s;pwd=%s;database=%s"),m_Server,m_LoginName,m_Password,db);
and any other call that uses literal strings should also have the _T().
I haven't used CERecordSet, so I don't know if it is Unicode aware. Is the Open() call specified to take an LPCTSTR (or a CString)? Does the GetField() member take an LPCTSTR (or a CString)?
You should look at the MSDN documentation for "Strings: Unicode and Multibyte Character Set (MBCS) Support". They do a pretty good job describing what to look for when using Unicode.
Best regards,
John
|
|
|
|
|
i have been using CToolBar but it only allows 16 colors (as far as I can tell).. so i tried switching to CToolBarCtrl.. but I never get any toolbar to appear.. can someone tell me what in my code is causing the toolbar to not show up, also does the AddButtons() command only take one TBBUTTON at a time?
I've been looking through msdn and on CP today, but can't find a basic example of thie CToolBarCtrl that works, as most of them call a command GetToolBarCtrl() which isn't a member of CToolBarCtrl, but rather CToolBar.. any help would be much appreciated!
i just want the toolbar to show up, from there i can add all my other button code:
m_wndToolBar.CreateEx(WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, WS_CHILD, CRect(CPoint(0,0),CPoint(500,510)), this, IDR_MAINFRAME);
m_wndToolBar.AddBitmap(17, IDB_SCTOOLBAR);
TBBUTTON btn;
btn.fsStyle = TBSTYLE_BUTTON;
btn.fsState = TBSTATE_ENABLED;
btn.idCommand = ID_FILE_NEW;
btn.iBitmap = 1;
m_wndToolBar.AddButtons(1, &btn);
also, what is the point of the CRect getting passed in the CreateEx? I have no idea what size CRect to pass here..
thanks!
-dz
|
|
|
|
|
If all you want is more than 16 colors, that is easily possible with the normal MFC toolbar support. Here is the process:
- Create the toolbar normally in the resource editor
- Edit the toolbar bitmap manually, converting it to high color
- The bitmap will be converted to 16 colors by MFC when it is loaded, so you will use the following code (nResourceId is the toolbar resource identifier, and m_toolbar is the CToolBar object):
HBITMAP hBmp = static_cast<HBITMAP>(LoadImage(AfxGetResourceHandle(),
MAKEINTRESOURCE(nResourceId), IMAGE_BITMAP,
0, 0, LR_SHARED | LR_LOADMAP3DCOLORS));
m_toolbar.LoadToolBar(nResourceId);
m_toolbar.SetBitmap(hBmp);
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
thank you so much! this worked great!
-dz
|
|
|
|
|