|
I think
#define _Module _AtlBaseModule
or
#define _Module (*_pAtlModule)
in your stdafx.h file will make it work.
|
|
|
|
|
Both of them don't work. The compile errors are:
#define _Module _AtlBaseModule
c:\wtl70\include\atldlgs.h(491): error C2039: 'ExtractCreateWndData' : is not a member of 'ATL::CAtlBaseModule'
#define _Module (*_pAtlModule)
c:\wtl70\include\atlctrls.h(1598): error C2039: 'GetResourceInstance' : is not a member of 'ATL::CAtlModule'
|
|
|
|
|
While iterating an ADO Recordset, I am reading a varchar (50) field from database and doing a cast to stl string in following way.
pRecordset->MoveFirst();
while (!pRecordset->adoEOF)
{
std::string homeAddress = (const char*) (_bstr_t) pRecordset->GetFields()->GetItem("HomeAddress")->Value;
// Doing some other stuff with string
pRecordset ->MoveNext();
}
HomeAddress field in database has quite a lot of records that have spaces embedded into them. I have seen that there is no problem until cast to const char*, but copying this into std::string sometimes get correct values and some times have garbage.
Initially I thought that It might be a problem for only records where it has space, but sometimes I am able to get correct value in std:string no matter it has space or not. I also tried replacing all the whitespace character with a space just to make sure that there is no null(\0) , but no luck.
Any help or tips on this would be highly appreciated
|
|
|
|
|
Anonymous wrote:
GetItem("HomeAddress")->Value
What type is Value ? Since that's the source of your data, that's the place to start looking. It needs to be a type that can be used to construct a _bstr_t for starters.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
A little confused about you question on "What type is Value"
This HomeAddress is a varchar(50) column in the database. The code i copied is pretty much all i am doing to read from database and converting to a std::string. Is there anything i be missing here?
|
|
|
|
|
Any help on this please
I Need to resolve this issue very urgently
|
|
|
|
|
varchar(50) is a database type, not a C++ type. What's the type of the data called "Value" that your code is using?
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
its std::string
i also tried with std::wstring
|
|
|
|
|
Then why are you trying to convert to _bstr_t and back, when a simple assignment to your string variable will do?
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a tab control and with a set of CDialogImpls (WS_CHILD) for each page (swap them in and out depending on what page is selected). With XP themes turned on, the background of these panes needs to be the same color as the tab control (which is different than the standard dialog background). The problem is that my little panes are drawing with the standard dialog background instead of the tab control background. It looks really ugly. I haven't had this issue with MFC apps, only WTL. I've tried a numerous set of flags on the dialog (including transparent) to no avail. Does anyone know of the correct way to set these dialog so that they work?
|
|
|
|
|
i have created an ATL Dll "Simple_ATL.dll" having one function "AddNumbers(long Num1, long Num2, long *ReturnVal)",how can i use this function in asp,so that i can send the parameters from asp page?Can any one help me Please?
Thanks in advance
|
|
|
|
|
Something like this:
Dim obj, i<br />
Set obj = Server.CreateObject("Simple_ATL.NumberAdder")<br />
i = obj.AddNumbers(2,3)
|
|
|
|
|
Did he say his interface is using automation ?
|
|
|
|
|
Hi All,
I've downloaded WTL7.0 and compiled and ran the BmpView example. I am experiencing performance problems running/debugging the application.
When I run the app., there is delay before I even see the GUI. Then the program's response is very slow. I performed a release build with Visual Studio.NET, I am running on Win2k Pro.,512RAM,850Mhz.
Maybe I have something setup wrong, new to WTL, any suggestions ?
Thanks in advance.
Update: Just tested on WinXP and runs great, my Win2k might be messed up, not sure
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Is there any WTL way to do this?
|
|
|
|
|
Use the DECLARE_WND_CLASS() family of macros in your CWindowImpl -derived class.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I don't quite understand how to use it. I'm coverting my project from Win32 to WTL and in plain Win32 I used a wclass value which i used in the CreateWindow function. How does this work in WTL? I can't find it in my 'documentation' neither.
Thnx
|
|
|
|
|
Oh, you're asking about the class name at the time you create the window. You don't put the class name there, because CWindow takes care of it.
class CMyWnd : public CWindowImpl<CMyWnd>
{
public:
DECLARE_WND_CLASS("MY_CLASS_NAME");
...
}; Then when you make a CMyWnd object and call its create, ATL handles the class name for you.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
How I make to develop an ATL control using MFC Print Preview callingr from Visual Basic or Visual C++ 5.0/6.0 Main program.
If it's possible, the ATL control may be an ocx thax i can use from these ambients and I have only 2 Events
OnPrinting <-- This is generate at the state change
OnPrintData <-- this is generate whe the controls may print data
I would also these procedure
SettingPage (One or several function)
PreviewOrPrint
DoPreview
DoPrint
Anyone can help me??
|
|
|
|
|
I want to make a multithreaded program by using
AfxBeginThread(...). I am not getting any relevent information about it. Since I don't want to use any other method or function for threading because it is considered to the most simple one for the beginners.
Please provive me with relevent sites/simple codes using this function as on every site I am finding different methods of handling threads and am confused.
Reply me soon
|
|
|
|
|
|
Hi Thomas. In your particular case, you don't need to delete each pair, nor even delete both members: std::string s take care of cleaning up their own resources, so you only have to cope with the second member of each pair:
template <typename T>
struct delete_second
{
operator()(T& t)const
{
delete t.second;
}
};
...
for_each(mymap.begin(),mymap.end(),delete_second<map <string, Type* >::value_type >());
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hi,
I am trying to use the static library which is having 4 to 5 functions.In
project settings-link tab i gave the library name and i included the header
files also.In spite of that it is giving this linker error.
What to do next.pl help
IPAddr.obj : error LNK2001: unresolved external symbol "struct value_pair *
__cdecl get_data(char * *,int)" (?get_data@@YAPAUvalue_pair@@PAPADH@Z)
|
|
|
|
|
It might be that the static library was built with the C runtime as a DLL while your main program was built with the C runtime statically linked.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|