|
Tim Smith wrote:
There is also the problem that if you name your H file after one of the system includes, it won't check for time changes.
Nope, I did a full search and there isn't anything that looks like my filename in the entire VS install. Nor is there anything in a full MSDN search with the same name.
I'm totally stumped.
J
|
|
|
|
|
Christian Graus wrote:
Have you tried renaming the class ?
Just tried it. Didn't help. But thanks.
I've looked through the preprocessor output and it's sitting right there.
It's as if it knows that CObjectCache is defined, and that CContainedObject is defined, but somehow CObjectCache<CContainedObject> isn't.
Does that make any sense?
J
|
|
|
|
|
I need a routine to save an icon to disc as an .ico file, or failing that copy an icon to the clipboard. Anybody know of one?
I'm never gonna work another day in my life. The gods told me to relax, They said I'm gonna get fixed up right. Monster Magnet, Powertrip
|
|
|
|
|
lookup the ICONINFO structure and search MSDN for the article "Icons in Win32"
- Roman -
|
|
|
|
|
Thanks!
I'm never gonna work another day in my life. The gods told me to relax, They said I'm gonna get fixed up right. Monster Magnet, Powertrip
|
|
|
|
|
Hey ! Anyone know how can i display a popup menu at top of mouse cursor(from bottom to top), anytime, even if the mouse isn't at the bottom of screen, and windows doesn't have to display the menu from bottom to top.
|
|
|
|
|
Do you mean you want the menu to be outside the screen?
I'm not sure of it if that is your question....
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
no... i didn't meant that...
i meant that if the mouse cursor is too close of the top of the screen to display the menu at bottom of the cursor, and normaly, by default, from down to top...
try to install trillian, and click the trilli button, and see where the menu is going from to where...
cheers
|
|
|
|
|
How can I get the string from a CString to a char*/char????
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
strcpy() or strncpy()
I'm never gonna work another day in my life. The gods told me to relax, They said I'm gonna get fixed up right. Monster Magnet, Powertrip
|
|
|
|
|
Holy god damnit!
I was soooooo sure it wouldn't work!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Must remember: the reason CString is so popular is MS made it easy for lazy programmers to use, and if you can't be a lazy programmer, then what's the point?
I'm never gonna work another day in my life. The gods told me to relax, They said I'm gonna get fixed up right. Monster Magnet, Powertrip
|
|
|
|
|
I have an active control which i need to insert during runtime . Assuming that the Active x class name is CActivex , how do i dynamically create windows and place them in an order for a MFC Dialog application ?
thanks
|
|
|
|
|
I think this should be works:
Insert the class and header of your activex to your project.Then you can define controler of it and use Create() function to create it at runtime.Is that clear?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I want to use the debugger to check if my arrays are filled correctly.
I have two arrays,
double xcoord1[80];
CPoint coord[80];
When I debug, I place my breakpoint right after I fill these arrays (still in the same function). Then I bring up the "Watch" debug window. But when I type xcoord1 under the name, i get the message: error in OMF type information.
And when I type coord, I get this under value: 0x0066f288
Why is all this happening?? And I know my array's have filled up properly, because if I put them to an oufile, I see that all the numbers I want are there. But why can't I view them with the debugger???
|
|
|
|
|
There's an article relating to some old versions of VC in MSDN that might help - I've never seen this problem myself:
"FIX: CXX0033 Error in OMF Type from Forward Class Declaration"
Seems to be a problem with the program database file when fwd decls used. What version of VC are you using?
|
|
|
|
|
|
I don't know about the error in OMF type information thing, but the second value is correct.
When you declare CPoint coord[80], coord actually becomes a (CPoint *) pointing to a block of 80 CPoint values. Therefore, when you view coord, it will display the address of the start of this memory block. There are two ways to look at the values in this array:
Add coord[0] or coord[53] to the Watch window to look at individual elements of this array, or copy 0x0066f288 to the Memory Debug window and look at the raw memory bytes (not so easy!).
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
You should be able to enter xcoord1,80 in the watch window to see all 80 elements of your array. Assuming you have managed to clear the OMF error problem.
I would recommend getting the book Debugging applications by John Robbins which gives lots of hints etc on how to get he most from your code and the IDE debugger.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
Hi
I'm currently working on a DLL in pure Win32API, i.e. with no MFC support.
Now I have one question:
I need to create a ListBox with multiple columns (like MFCs CListCtrl).
Is this possible in Win32 API?
With CreateWindow() I can create a simple ListBox (like MFCs CListBox), however it does not support multiple columns
How can I create such a ListCtrl?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
The listctrl is part of the common contrls library so you must include the standard inclusion file commctrl.h.
Also make sure the common controls lib in linked into your program. comctl32.lib
Allpcaitions that use common controls (SDK) must call InitCommonControlsEx() before using any common control.
In your case:
INITCOMMONCONTROLSEX cc;
cc.dwSize = sizeof(INITCOMMONCONTROLSEX);
cc.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&cc);
Common controls are created like built in "BUTTON" or "EDIT" windows.
Using List View Controls - Under your help files
hwndLV = CreateWindow(WC_LISTVIEW, "",
WS_CHILD | VS_REPORT | LVS_EDITLABELS, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, hwndParent, NULL, g_hinst, NULL);
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
hi, i need create an atribute from a managed cv++ class in a unmanaged vc++ class.
Anyone knows why?
thanks in advance.
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
Hello Friends,
In fact I do not know that template definition must be made inside the class. Is it really necessary?.
But, unfortunately I have encountered much more difficult problem with other template functions as described below.
I have five overloaded functions in a class as shown below:
template <typename r,="" class="" c,="" typename="" t1="">
RPC::ParamList runMethod(RPCServer &instance, R (C::*methodPtr)(T1)
, const RPC::ParamList ¶ms)
{
RPC::ParamList results;
zinc_assert(params.size( ) == 1);
// Convert params
T1 arg1;
zinc_assert(params[0].type == RPC::typeOf(arg1));
fromString(arg1, params[0].value);
// Invoke method
C *cl = dynamic_cast<c *=""> (&instance);
zinc_assert(cl);
R result = (cl->*methodPtr)(arg1);
// Package results
RPC::Parameter r;
r.type = RPC::typeOf(result);
r.value = ::toString(result);
results.push_back(r);
return results;
}
template <typename r,="" class="" c,="" typename="" t1,="" t2="">
RPC::ParamList runMethod(RPCServer &instance, R (C::*methodPtr)(T1, T2)
, const RPC::ParamList ¶ms)
{
RPC::ParamList results;
zinc_assert(params.size( ) == 2);
// Convert params
T1 arg1;
zinc_assert(params[0]->type == RPC::typeOf(arg1));
::fromString(arg1, params[0]->value);
T2 arg2;
zinc_assert(params[1]->type == RPC::typeOf(arg2));
::fromString(arg2, params[1]->value);
// Invoke method
C *cl = dynamic_cast<c *=""> (&instance);
zinc_assert(cl);
R result = (cl->*methodPtr)(arg1, arg2);
// Package results
RPC::Parameter *r = new RPC::Parameter;
r->type = RPC::typeOf(result);
r->value = ::toString(result);
results.push_back(r);
return results;
}
// Partial template function overload for vector argument
template <typename r,="" class="" c,="" typename="" t1="">
RPC::ParamList runMethod(RPCServer &instance
, R (C::*methodPtr)(vector<t1>)
, const RPC::ParamList ¶ms
)
{
RPC::ParamList results;
vector<t1> arg1;
{ // Convert params
zinc_assert(params[0]->type == RPC::ARRAY);
int stated_size;
::fromString(stated_size, params[0]->value);
zinc_assert(params.size( ) == stated_size + 1);
T1 t;
int i;
for (i = 1; i < stated_size + 1; ++i) {
zinc_assert(params[i]->type == RPC::typeOf(t));
::fromString(t, params[i]->value);
arg1.push_back(t);
}
}
// Invoke method
C *cl = dynamic_cast<c *=""> (&instance);
zinc_assert(cl);
R result = (cl->*methodPtr)(arg1);
// Package results
RPC::Parameter *r = new RPC::Parameter;
r->type = RPC::typeOf(result);
r->value = ::toString(result);
results.push_back(r);
return results;
}
// Partial template functin overload for vector result
template <typename r,="" class="" c,="" typename="" t1="">
RPC::ParamList runMethod(RPCServer &instance
, vector<r> (C::*methodPtr)(T1)
, const RPC::ParamList ¶ms
)
{
RPC::ParamList results;
zinc_assert(params.size( ) == 1);
// Convert params
T1 arg1;
zinc_assert(params[0]->type == RPC::typeOf(arg1));
::fromString(arg1, params[0]->value);
// Invoke method
C *cl = dynamic_cast<c *=""> (&instance);
zinc_assert(cl);
vector<r> result = (cl->*methodPtr)(arg1);
{ // Package results
RPC::Parameter *r = new RPC::Parameter;
r->type = RPC::ARRAY;
r->value = ::toString(result.size( ));
results.push_back(r);
vector<r>::iterator i = result.begin( );
vector<r>::iterator n = result.end( );
for (; i != n; ++i) {
r = new RPC::Parameter;
r->type = RPC::typeOf(*i);
r->value = ::toString(*i);
results.push_back(r);
}
}
return results;
}
// Partial template functin overload for vector argument & result
template <typename r,="" class="" c,="" typename="" t1,="" t2="">
RPC::ParamList runMethod(RPCServer &instance
, vector<r> (C::*methodPtr)(const vector<t1> &, const vector<t2> &)
, const RPC::ParamList ¶ms)
{
RPC::ParamList results;
vector<t1> arg1;
{ // Convert params
zinc_assert(params[0]->type == RPC::ARRAY);
unsigned int stated_size;
::fromString(stated_size, params[0]->value);
zinc_assert(params.size( ) > stated_size + 1);
T1 t;
unsigned int i;
for (i = 1; i < stated_size + 1; ++i) {
zinc_assert(params[i]->type == RPC::typeOf(t));
::fromString(t, params[i]->value);
arg1.push_back(t);
}
}
unsigned int arg2Idx;
::fromString(arg2Idx, params[0]->value);
arg2Idx += 1;
vector<t2> arg2;
{ // Convert params
zinc_assert(params[arg2Idx]->type == RPC::ARRAY);
unsigned int stated_size;
::fromString(stated_size, params[arg2Idx]->value);
zinc_assert(params.size( ) > stated_size + 1);
T2 t;
unsigned int i;
for (i = arg2Idx + 1; i < stated_size + arg2Idx + 1; ++i) {
zinc_assert(params[i]->type == RPC::typeOf(t));
::fromString(t, params[i]->value);
arg2.push_back(t);
}
}
// Invoke method
C *cl = dynamic_cast<c *=""> (&instance);
zinc_assert(cl);
vector<r> result = (cl->*methodPtr)(arg1, arg2);
{ // Package results
RPC::Parameter *r = new RPC::Parameter;
r->type = RPC::ARRAY;
r->value = ::toString(result.size( ));
results.push_back(r);
vector<r>::iterator i = result.begin( );
vector<r>::iterator n = result.end( );
for (; i != n; ++i) {
r = new RPC::Parameter;
r->type = RPC::typeOf(*i);
r->value = ::toString(*i);
results.push_back(r);
}
}
return results;
}
The following function calls are not getting resolved.It says no overload is matching.
1.
result = _server->runMethod(*this, &ClassifyDimensionServer::serverSyncDVals, params );
Where vector<dvalid> serverSyncDVals(const vector<dimensionid>&, const vector<string>&)
2.result = _server->runMethod(*this,&ClassifyDimensionServer::serverAutoGenDimension, params);
where DimensionId serverAutoGenDimension(DValId, string);
If you want complete details of each and every parameter I will be able to provide. Please let me know if there is something we need to take care of in VC60.
Is the following change correct?
//DValIds result = Client::runOnServer<dvalid>
// (*_client, *this, func, dimensionIds, dvalNames);
//' VC60 does not support explicit template arguments.
//' -Sarma - 08-Apr-2002
DValIds result = Client::runOnServer
(*_client, *this, func, dimensionIds,
dvalNames,(DValId)0);
The last argument is added as dummy argument to use all template arguments in parameters.
I shall be very thankful, if you please help me in this matter.
Thanks again,
-Sarma
|
|
|
|
|
Hello. I am stuck on my first
external function call.
Here is a short program:
// convert string to long double
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
char str1[] = "123.21";
long double _atold(const char *);
long double d = _atold(str1);
cout << d;
return 0;
}
My problem is using the _atold() library function, which is in the math.h file.
I have tried everything, and
get the link error -
unresolved external symbol "long double __cdecl _atold(char)" (?_atold@@YAOD@Z)
I would REALLY appreciate help
on this one. I could use
other methods, but I want to
get this working. Thanks
David
|
|
|
|
|
do you mean the function which convert a string to a double variable? It's atof().
example:
#include <stdio.h>
#include <strlib.h>
.....
char s[10] = "123.41"; double x;
x = atol(s);
printf("%f\n", x);
....
I didn't find any funciton defined as atold. There is atof, and atoi (to an integer) and atol (to a long value).
|
|
|
|
|