|
Your answer's in the VC forum FAQ.
--Mike--
"Everyone has figured out what 'service pack' really means, so they had to go and change the language. Perhaps this is what Bill was talking about in the 'security is top priority' letter."
-- Daniel Ferguson, 1/31/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
I do Excel Automation used "EXCEL9.OLB" in VC++.
but i can't show dialog that new document dialog or chart dialog.
how can do that??
|
|
|
|
|
Create View who can contian ExcelObject, put the view int the Dialog
|
|
|
|
|
CAN ANYONE tell me please how do you convert a string that you read from standard input to an int.
thank you.
|
|
|
|
|
atol () is one way.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
you saved my life!
|
|
|
|
|
you can use "scan" function too!
|
|
|
|
|
Hi, everybody,
This may be a stupid question, but I really hope somebody to help me...
I got some trouble about the "unit" and "unit conversion" for rendering an image.
I have read some people's share codes on this web site. Those codes are all for image rendering with the COM interface IPicture. Here are my questions.
1. IPicture::get_Width: Returns the current width of the picture in the picture object. (from MSDN), the API is as follows:
HRESULT get_Width( OLE_XSIZE_HIMETRIC* pwidth //Receives a pointer to width );
My question is, what kind of unit we get from pwidth ? I mean, is pwidth in inch ? or in mini-meter ? or anything else ? Does this IPicture use MM_HIMETRIC coordinate system ?
2. If there are some code segment related to calculate the dimension (in pixels) of an image,
HIMETRIC_INCH is 2540
long hmWidth;
long hmHeight;
m_pPicture->get_Width(&hmWidth); /// m_pPicture is of type pointer to ///IPicture
m_pPicture->get_Height(&hmHeight);
rcResult.cx = MulDiv(hmWidth, pDC->GetDeviceCaps(LOGPIXELSX), HIMETRIC_INCH);
rcResult.cy = MulDiv(hmHeight, pDC->GetDeviceCaps(LOGPIXELSY), HIMETRIC_INCH);
Could anybody explain why HIMETRIC_INCH (2540) is used above ? And explain more about the above formula ? Is hmWidth (or hmHeight) in mini-meter ?
Thanks in advance ! Any reponse will be appreciated !
|
|
|
|
|
change of pixels to inc or cm
|
|
|
|
|
Does SQL Server process two commands through the same connection in parallel or does it perform the commands in a sequential manner (FIFO)? I am using the OLEDB consumer template class (CSession) for connecting to the SQL Server.
I have been trying to locate some material on this for the past one week, but was unsuccessful. I would appreciate any help in this regard very much.
Thank you
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Don't quote me, I'm just guessing here, but I would imagine it does something like the following.
A statement parser in its own thread recieves SQL, breaks it into tokens, and converts it to a bytecode or object placed in a quenue.
A pool of workers picks items off this quenune in some manner, perhaps FIFO, perhaps according to a 'statement-complexity' algo so quick requests go through first or something. It gets the data and creates a response object or bytecode and puts it in an output quenue.
Finally, the output engine pops items off and sends the response back to the client.
There might be steps which are better, but with my knowledge, thats how i would build a sql engine.
// Rock
|
|
|
|
|
Has anyone used Visual Assist 5 for VS.NET? I know it's still in beta right now. Is it stable and worth using?
Jon Sagara
What about ?
|
|
|
|
|
The following class, is a class to make register changes easy. But there is a memory leak, somewhere, and I can't locate it, help me.
CRegisterEx.h
#pragma once
#include "stdafx.h"
class CRegisterEx
{
public:
CRegisterEx(LPCSTR path);
~CRegisterEx(void);
public:
void WriteString(LPCSTR str, LPCSTR subKey = NULL);
LPCSTR ReadString(LPCSTR subKey = NULL);
void WriteInteger(int i, LPCSTR subKey = NULL);
int ReadInteger(LPCSTR subKey);
};
CRegisterEx.cpp
#include "StdAfx.h"
#include "registerex.h"
#include <stdlib.h>
LPCSTR pt;
CRegisterEx::CRegisterEx(LPCSTR path)
{
pt = path;
path = NULL;
}
CRegisterEx::~CRegisterEx(void)
{
pt = NULL;
}
// Main course, are made for public use, but are also used inside
void CRegisterEx::WriteString(LPCSTR str, LPCSTR subKey)
{
CString insidePath = pt;
if (subKey)
{
insidePath = insidePath + "\\" + subKey;
}
LPCSTR realPath = (LPCSTR)insidePath;
RegSetValue(HKEY_CURRENT_USER, _T(realPath), REG_SZ, _T(str), sizeof(realPath));
realPath = NULL;
}
LPCSTR CRegisterEx::ReadString(LPCSTR subKey)
{
CString insidePath = pt;
if (subKey)
{
insidePath = insidePath + "\\" + subKey;
}
LPCSTR realPath = (LPCSTR)insidePath;
TCHAR str[2048];
LONG strValue = sizeof(str);
RegQueryValue(HKEY_CURRENT_USER, _T(realPath), str, &strValue);
#pragma warning (disable : 4172)
return (LPCSTR)str;
}
// now we go real public
void CRegisterEx::WriteInteger(int i, LPCSTR subKey)
{
char buffer[2048];
_itoa(i, buffer, 10);
LPCSTR str = (LPCSTR)buffer;
WriteString(str, subKey);
}
int CRegisterEx::ReadInteger(LPCSTR subKey)
{
LPCSTR str = ReadString(subKey);
int i = atoi(str);
return i;
}
N.B. I use CString, so you should load the MFC/ATL/WTL version of it, else, you must change this yourself (if you did so, please notify me, so it's fully win32)
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Your code has several bugs: (maybe one of them is causing the leak)
RegSetValue(HKEY_CURRENT_USER, _T(realPath), REG_SZ, _T(str), sizeof(realPath)); Here, sizeof(realPath) equals 4 (the size of a pointer) which is not what you want; use srtlen(realPath) instead.
TCHAR str[2048];
LONG strValue = sizeof(str);
RegQueryValue(HKEY_CURRENT_USER, _T(realPath), str, &strValue);
#pragma warning (disable : 4172)
return (LPCSTR)str; Here you're returning a pointer to a char buffer constructed on the stack; this pointer becomes invalid as soon as the function exits (the buffer goes out of scope). I suggest you change the prototype of ReadString to return a CString and rewrite that portion of code like this:
TCHAR str[2048];
LONG strValue = sizeof(str);
RegQueryValue(HKEY_CURRENT_USER, _T(realPath), str, &strValue);
#pragma warning (disable : 4172)
return CString(str); Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Well, the problems are solved. I will upload the finished CRegisterEx when there are enough methods to be used.
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Can anyone recommend a good book for a c++ programmer wanting to learn STL?
Thanks
|
|
|
|
|
Christian Graus recommended the following:
"And you'll never regret it. Do you have any books ? I recommend STL tutorial
and Reference or Generic Programming and the STL ( probably the latter as it's a
better reference and moves faster ), and you will *need* Effective STL by Scott
Meyers, probably the best book I bought this year."
HTH
Jon Sagara
What about ?
|
|
|
|
|
I'm getting back to development mode, and I find that the Tools/Customize window in VS6 no longer has a Macro/Add-in tab. Anyone have an idea what happened? The only tools that I know I was using were the Resource Organizer and the code-reformatter, both available on CP.
I loaded SP5 again, which was already installed, and re-booted, and still nothing.
Any words of wisdom (applicable to this problem) would be appreciated.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hey all-
For several years now, the standard M.O. for me has been that when a new version of MSDN was released, I would uninstall the previous version, then install the new version, and all would be ok from VS' standpoint.
I just installed MSDN for Jan2002 and have been greeted by a "MSDN not installed. Please install MSDN" error from within VisualStudio 6. I chose the same directory and such as I always have, but all of a sudden VS isn't finding it. Presumably it *should* work with 6, as I have found nothing in the documentation to say that it doesn't work, but perhaps I have to fiddle with the registry to have VS find it?
Thanks for any info,
Ron
|
|
|
|
|
It is my understanding that from Jan 2002, MSDN will only intergrate with Visual Studio 7 and not version 6. If you want Version 6 integration you''ll need to keep October 2001 installed.
Michael
|
|
|
|
|
Welcome to the f***ing world of .NET. You have to stick with the Oct 2001 MSDN in order to use it with VC 6.
"We're telling you where you will go today." -- Microsoft
--Mike--
"Everyone has figured out what 'service pack' really means, so they had to go and change the language. Perhaps this is what Bill was talking about in the 'security is top priority' letter."
-- Daniel Ferguson, 1/31/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
I always run a seperate instance of MSDN rather than use it from VS.
|
|
|
|
|
I installed new version of .Net last night,and MSDN was part of it,and many article is updated and changed.I think for VC++6 it is better to use old version of MSDN
Mazy
|
|
|
|
|
This is a post I put round work today re this:
"Dear All,
Be aware that the new MSDN Jan 2002 collection does not work with visual studio 6 (F1 for example produces an error).
A quick investigation reveals that MS have changed their help system (again) - it now uses the:
C:\Program Files\Common Files\Microsoft Shared\Help\dexplore.exe
'Document Explorer' to launch the collection. Since this is significantly different from .chm files and suchlike it ain't
gonna work for VS6. Their may be a way to hack around this - the collection is nominally launched through VS
via an intermediary DLL (vshelpui.dll - i think) and checks the following key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTML Help Collections
Of interest is this -
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTML Help Collections\Developer Collections\0x0409\0x039a1a660
which points at the chm collection for old MSDN installs and tells VC6 where to find it.. Basically MSDN *used* to tell
VS6 where to find it and how to launch it. MS couldn't make MSDN compatible with VS6 and/or couldn't be
bothered to produce a patch for VS6 to launch things correctly.
You can add a tool to the tools menu (really) that launches the new MSDN via the following path
"C:\Program Files\Common Files\Microsoft Shared\Help\dexplore.exe" "
And yes, it sucks
|
|
|
|
|
Ok, me again. Worked out the following. You can install BOTH MSDN Oct
and MSDN Jan 2k2 on the same machine - and they work with both VS .NET and VS 6. Yay! We're using a network install here so the total cost of having
VS .NET plus two MSDN 'lite' installs is about 1 GIG.
Works for me..
Timbo
|
|
|
|