|
Yea I am running that command right after ShowWindow, makes no difference.
It sounds like I am callig the wrong HWND handle, but my main window is m_hWnd, everything else is a child of that. I just breifly double checked all my other HWND handles and found them all WS_CHILD. with m_hWnd as the parent accept the tooltips. My tooltips are children to the window in which they tip. I thought thats how I was suppose to do it but I dont think that will make a difference here.
Any thoughts?
|
|
|
|
|
Is anyone of you familiar with Anti-Grain Geometry? I just stumbled across it this week and would love to use it in my program but I can't figure out HOW to use it!
I am trying to use the C# wrapper created by the guys at CreativeDocs.Net --> http://www.creativedocs.net/
I just need someone to quickly explain how to replace gdi with agg.
Just so you know, I have exhuasted google trying to find some kind of documentation.
Any pointers would be greatly appreciated!
Richard
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
|
Hello Friends,
I have created the New Desktop. And I am able to Switch to and from new Desktop to Default Desktop and Default Desktop to New desktop (Thnx to nitin3 ) .
But There is one Problem I am facing when I am switching to new Desktop.
I am not able to open the Task Manager in new desktop
If anybody knows how to solve the problem or why this is happening ? if anybody knows please tell me. It will be great help to me.
The other things I want to do is to personalize the ICONS and Wallpaper for new Desktop. i.e. if somebody changes the wallpaper in new desktop it should not be reflected in default desktop.
I dont know whether it is possible or not ??. If Some body have anu idea or suggation please tell me.
Thanx in Advance
|
|
|
|
|
Alright, this is not code oriented and so I'll make it brieft:
Sorry don't know how to add code in this forum yet (rather new)
A class like this:
#ifndef VXT_SIMPLE_BUTTON_SPEC<br />
#ifdef VXT_UIUTILS_DLL<br />
#define VXT_SIMPLE_BUTTON_SPEC __declspec(dllexport)<br />
#else<br />
#define VXT_SIMPLE_BUTTON_SPEC __declspec(dllimport)<br />
#endif<br />
#endif<br />
<br />
class VXT_SIMPLE_BUTTON_SPEC vxtUISimpleButton: public CGXStatic
the inherited class is FROM stingray and is now using dll interface compared to previous release like so:
#ifdef _GXDLL<br />
#ifdef _GXDLL_IMPL<br />
#define GRID_API __declspec( dllexport )<br />
#else<br />
#define GRID_API __declspec( dllimport ) <br />
#endif<br />
#else // !_GXDLL<br />
#define GRID_API<br />
#endif<br />
<br />
<br />
class CGXStatic : public CGXControl<br />
{<br />
DECLARE_CONTROL(CGXStatic)<br />
<br />
public:<br />
GRID_API CGXStatic(CGXGridCore* pGrid);<br />
<br />
GRID_API virtual CRect GetCellRect(ROWCOL nRow, ROWCOL nCol, LPRECT rectItem = NULL, const CGXStyle* pStyle = NULL);<br />
GRID_API virtual CSize AddBorders(CSize size, const CGXStyle& style);
<br />
GRID_API virtual CSize CalcSize(CDC* pDC, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle, BOOL bVert);<br />
<br />
GRID_API virtual BOOL CanFloatCell(ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, BOOL bFloatOrFlood);<br />
<br />
GRID_API virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);<br />
<br />
GRID_API void ImplementCellTips();<br />
};<br />
Now this returns:
error C2487: member of dll interface class may not be declared with dll interface
When using the macro:
#define DECLARE_CONTROL(class_name) \<br />
protected: \<br />
GRID_API static CGXControlClass* PASCAL _GetControlBaseClass(); \<br />
public: \<br />
static GX_DATA CGXControlClass ctrl##class_name; \<br />
GRID_API virtual CGXControlClass* GetControlClass() const; \<br />
<br />
#define IMPLEMENT_CONTROL(class_name, base_class_name) \<br />
CGXControlClass* PASCAL class_name::_GetControlBaseClass() \<br />
{ return CONTROL_CLASS(base_class_name); } \<br />
GX_DATADEF CGXControlClass class_name::ctrl##class_name = { \<br />
#class_name, &class_name::_GetControlBaseClass }; \<br />
CGXControlClass* class_name::GetControlClass() const \<br />
{ return &class_name::ctrl##class_name; } \<br />
<br />
DECLARE_CONTROL(vxtUISimpleButton)
So I tried not using dllimport ON the class but instead on every functions
Which returned this:
warning C4273 : inconsistent dll linkage
on the macro:
<br />
#define IMPLEMENT_CONTROL(class_name, base_class_name) \<br />
CGXControlClass* PASCAL class_name::_GetControlBaseClass() \<br />
{ return CONTROL_CLASS(base_class_name); } \<br />
GX_DATADEF CGXControlClass class_name::ctrl##class_name = { \<br />
#class_name, &class_name::_GetControlBaseClass }; \<br />
CGXControlClass* class_name::GetControlClass() const \<br />
{ return &class_name::ctrl##class_name; } \<br />
<br />
IMPLEMENT_CONTROL(vxtUISimpleButton, CGXStatic)
Which is present because (I think) that we defined this function:
virtual VXT_SIMPLE_BUTTON_SPEC vxtVoid Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);
and the stingray class defined it this way:
GRID_API virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);
Both are on dllImport
Any suggestion on how to "cleanly" remove the error and warning?
|
|
|
|
|
I want to know how can i get the file of '.dll' of CxImage?when i load the CxImage,i cannot find the file.Thank you!
My Email is xhj131@163.com
jane
|
|
|
|
|
Did you ask on that article?
|
|
|
|
|
Yes,i asked about the CxImage.Do you know something about it?If you do,i hope you can help me.
I want to change the format of the image from ".jpg" to ".bmp"!
Thank you
Jane131
|
|
|
|
|
If you want to convert jpg to bmp why you dont use of CImage class?
|
|
|
|
|
I have considered about CImage class,but i can not find the
the file of ".dll"and ".lib".Do you know how can i get them?
Thank you!
|
|
|
|
|
CImage class dont need to dll file its ATL class and use of it is simple
#include "AtlImage.h"
CImage m;
m.Load("c:\\123.jpg");
m.Save("c:\\123.bmp");
m.Destroy();
Did you try like this code?
|
|
|
|
|
Thank you for your help!
The CImage class is not the same as the CxImage class,isn't it?I want to make sure it.
I have to realize the convert from jpg to bmp.But the new probrom come up.Because the jpg is 24 bit,when it was converted to bmp,the bmp was 24 bit too.But i want to 8 biBitCount(256 color),how should i do?
|
|
|
|
|
Yeah thats right they are different sometimes some people think they are same but it has a X. and for second section of your question I done previous and I dont remember it I suggest ask at the new thread.
|
|
|
|
|
I was think about convert
24 bit true color jpg->24 bit bmp->8 biBitCount bmp(256 color)-> gray bmp->binarization bmp
But i find it will distortion when from 24 bit bmp to 8 biBitCount bmp(256 color)
So i think about the process about:
24 bit true color jpg->8 bit gray jpg->8 biBitCount bmp(256 color)->binarization bmp.
I now think about the step of 24 bit true color jpg->8 bit gray jpg,i know the photoshop can realize it,but i don't know how does it realize it?
|
|
|
|
|
For convert jpg to bmp I saw this thread that Mark Salsbery wrote for someone here[^] and also I think Mark can helps you for convert,so I suggest ask of him.
|
|
|
|
|
|
I also want a cximagecrtd.dll, would anyone like give me one copy? My Email is quiettimes@163.com. Thank you very much!
|
|
|
|
|
Hi,
Im trying to read a value of the registry in VC++ using the class CRegKey from the < atlbase.h >
but something is not working. Using the VC++ help I have tried with this code:
CRegKey rkMyRegKey;
CString szValue = "";
LONG lnResult = -9999;
ULONG iLength = sizeof(szValue);
lnResult = rkMyRegKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE\\DELTALOGIC\\AGLink\\Device0");
lnResult = rkMyRegKey.QueryValue((LPTSTR) &szValue, "IFPARA_TCPIP", &iLength);
rkMyRegKey.Close ();
and it works half correct. The variable iLength gives me the value 1252 in the debugger (the large in Bytes of the entry I want to read), but the szValue has no values and the lnResult is 234 (being 0 = ERROR_SUCCESS) in the previous line. I have look for the error but I didn't found the meaning of the value 234.
After checking the forum and found a post this (march 07)[^] and I have tried this.
HKEY hWkKey;
CString szValue = "";
LONG lnResult = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\DELTALOGIC\\AGLink\\Device0", 0, KEY_ALL_ACCESS, &hWkKey);
if(lnResult == ERROR_SUCCESS)
{ ULONG iLength = sizeof(szValue);
lnResult = RegQueryValueEx(hWkKey, "IFPARA_TCPIP", 0, NULL, (BYTE *) &szValue, &iLength);
if (lnResult != ERROR_SUCCESS)
AfxMessageBox ("Error by requesting the value");
}
RegFlushKey(hWkKey);
RegCloseKey(hWkKey);
And I got the same 234 error and the same value 1252 for iLength, but no result in the szValue.
Can someone tell me what am I not understanding?
-- modified at 9:02 Friday 5th October, 2007
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: ULONG iLength = sizeof(szValue);
What exactly are you expecting this to do? iLength is the size of the class, not the size of the class' internal buffer.
Nelek wrote: lnResult = rkMyRegKey.QueryValue((LPTSTR) &szValue, "IFPARA_TCPIP", &iLength);
Not even close. Try:
iLength = 256;
lnResult = rkMyRegKey.QueryValue(szValue.GetBuffer(iLength), "IFPARA_TCPIP", &iLength); Nelek wrote: I have look for the error but I didn't found the meaning of the value 234.
Where did you look? It's in winerror.h .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry for the delayment, I had no oportunity to come before.
1 question:
Quote from Help of VC++ 6.0
"pdwCount [in, out] The size of the string data. Its value is initially set to the size of the szValue buffer."
On the other hand, I was looking for info in the site and I found a place where it was done like this. I tested and, actually, the 1252 was at the end in the variable iLength.
Because of both I used it in that way.
//..............
About the try... 256 gives the same result. Incoming iLength = 256, after the line iLength = 1252.
//..............
I was looking in the atlbase.h because is the header I should include in order to use the CRegKey and afterwards I was looking in every *.h of the folder without success. Winerror.h is in other path.
Anyways... Thanks a lot for your answer, I have learn some things that I didn't know.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
try this given code for reading the registery...
call this like....
Ex.
CString str;
ReadFromRegistry(HKEY_LOCAL_MACHINE,"SOFTWARE\\DELTALOGIC\\AGLink\\Device0", "IFPARA_TCPIP", str,260);
Function:
BOOL ReadFromRegistry(HKEY hRegRootPath, CString strRegPath, CString strRegAttribute, CString &strAttributeValue, DWORD len)
{
CRegKey key;
if(key.Open(hRegRootPath, strRegPath,KEY_READ) == ERROR_SUCCESS)
{
char strvalue[128];
if(key.QueryValue(strvalue,strRegAttribute,&len) == ERROR_SUCCESS)
{
strAttributeValue = strvalue;
key.Close();
return TRUE;
}
}
key.Close();
return FALSE;
}
Rahul Vaishnav
|
|
|
|
|
Rahul Vaishnav wrote: ReadFromRegistry(HKEY_LOCAL_MACHINE,"SOFTWARE\\DELTALOGIC\\AGLink\\Device0", "IFPARA_TCPIP", str,260);
Which will fail miserably since the buffer used by ReadFromRegistry() is only 128 bytes, yet you are telling it the length is 260 bytes.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the code and the posterior correction. I am going to try it.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
It looks like you're able to successfully open the registry key.
Your problem is when you're trying to read the contents of the value "IFPARA_TCPIP".
Nelek wrote: Can someone tell me what am I not understanding?
Basically you haven't understood how to use this function and how to interpret the error returned.
The error returned tells that there is more data to be read, i.e. the size of the buffer you provided was too small to hold the contents of the registry value. The length returned is the complete length that is required to hold the data, i.e. 1252 bytes.
Try this after you've opened the registry key successfully (non CRegKey version):
BYTE* pBuffer = NULL;
lnResult = ::RegQueryValueEx( hWkKey, "IFPARA_TCPIP", 0, NULL, NULL, &iLength );
if( (lnResult == ERROR_SUCCESS) && iLength )
{
DWORD dwType;
pBuffer = new BYTE[iLength];
::RegQueryValueEx( hWkKey, "IFPARA_TCPIP", 0, &dwType, pBuffer, &iLength );
if( dwType == REG_SZ )
{
szValue = pBuffer;
}
delete [] pBuffer;
pBuffer = NULL;
}
Read more about ::RegQueryValueEx() here[^] and a list of possible data types to store in the registry here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Yes, I am able to open and delete keys / subkeys.
I had made a "bypass" to allow not using the QueryValue (testing only the TCP/IP connection with the 1st member), but now I am forced to use it because I have to differenciate between 4 multiple choices. The value are written in a REG_DWORD to know about the option (MPI_S7 = 0x00, TCP/IP_S7 = 0x03, MPI_S5 = 0x06, TCP/IP_S5 = 0x0B). And depending on what is choosen, go through one function or another.
It seems you are right I was not understanding the functions. VS Help is not very understable for me (35% of contents are on English and the rest on german, and I am spanish , even the MSDN on spanish was made with a translator-bot and even sometimes is difficult for me to understand it )
With the example you have provided me (very good explanation thanks) and both links I think I will be able to solve my problem
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|