|
RGB(256,256,256) is like RGB(0,0,0). Max channel value is 255.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
hi,
this is the debug result:
f:\projects center\task history\mission 8_13\hydrosrv\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
and this is the source of warning:
enum RecordCreateOptionsEnum
{
adCreateCollection = 8192,
adCreateStructDoc = -2147483648,
adCreateNonCollection = 0,
adOpenIfExists = 33554432,
adCreateOverwrite = 67108864,
adFailIfNotExists = -1
};
tell me how to fix this problem.
Thanks in advance
Extreme programming. Do the No.1
|
|
|
|
|
adCreateStructDoc = 0x80000000
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Hi
I have some dll set which I'm using in VC7. As long as it was compiled in VC7 everything was fine. Now, when I'm using the same dlls compiled in VC6, my program crashes when I'm trying to execute some code from this dlls. Is this a problem of using import libraries (lib files) from VC6 (I mean that maybe lib files from VC6 cannot be used in VC7), or maybe whole dlls are incompatible (this would be very stupid I think), or maybe this dlls are just buggy(and previous dlls compiled in VC7 are not buggy). If this is a problem of lib files is there a way to convert lib from VC6 to VC7 (I can't recompile this dlls). I know one "easy" solution to my problem: getting back to VC6, but of course it's not a good idea (probably I used some VC7 features and because program is quite big there would be a lot of work to do, additionally I just got used to VC7 and I like it ). Anyone have some hints? Thanks in advance
Mariusz Popiolek
|
|
|
|
|
Hi,
I've written a code which replaces characters in a string with their respective URLEncode (i.e a " " will be replaced by "+" etc..).
However the code crashes at execution.
Please help!!
Here's the code extract;
Code:
>-----------------------------------------------------------------------------
for(j=0;j
|
|
|
|
|
|
for(j=0;j<one.length();j++)
{
indxD = one.find_first_of ( " " , 0 );
one.replace(indxD,1,"%2B",3);
}
From the problem I see, you should escape % and replace it to %%2B, while the length is still 3. (Escaping escape code, weird that!).
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
In addition, your encode routine is completely wrong. Spaces should be replaced with +, while non alphabetical characters should be replaced with their hex ascii representation prefixed with a %.
That's not exactly what you are doing.
It's also questionable because whether you are using javascript (escapeurl), ASP (urlencode), C++ (InternetCanonicalizeUrl, UrlEscape), .NET (HttpUtility.UrlEncode), you've many SAFE ways to do it already. Why reinvent that f***ing squared wheel ?
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
i connect to a server (a game server), now i want to know the server's ip address (i.e. 123.222.111.222) and port the server used, do u think it is possible?
thanks for any info and help.
includeh10
|
|
|
|
|
includeh10 wrote:
i connect to a server (a game server), now i want to know the server's ip address (i.e. 123.222.111.222) and port the server used, do u think it is possible?
Well, to connect to the server you need the IP address of the server (or domain name) and the listening port. So if you do not know either of them, you wouldn't be in the server in the first place.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
try tracert in a dos console.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
or try netstat in a dos console to find a list of connections your computer currently has.
|
|
|
|
|
Hello everyone,
I am writing a application that has a notify icon in the status area. Now I get in trouble in preventing the icon disappearing after the 'explorer.exe' is terminated and restarted. Who can help me? Thanks.
Kerry Chou (STU)
Kerry Chou from STU
|
|
|
|
|
[already answered you in the newsgroup, but in this case you also get mail notification]
If your main window receives a message whose value is equal to RegisterWindowMessage(TEXT("TaskbarCreated")) then this means the taskbar is being recreated and you should re-add your tray icons. Remember that this message is NOT sent to your tray icon message handler, but it is sent to the application's top level window (usually your main frame window)
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thank you Nish, I have resolved the problem.
But I can not find any information about the 'lpString' parameter of 'RegisterWindowMessage(LPCTSTR lpString)' function in MSDN, how can I identify the lpString parameter when I want to define a new window message?
Thanks!
Kerry Chou from STU
|
|
|
|
|
Kerry Chou wrote:
Thank you Nish, I have resolved the problem.
But I can not find any information about the 'lpString' parameter of 'RegisterWindowMessage(LPCTSTR lpString)' function in MSDN, how can I identify the lpString parameter when I want to define a new window message?
Thanks!
Kerry,
RegisterWindowMessage is used to register custom messages. Say you have 3 apps all wanting to communicate to each other. Now you can use RegisterWindowMessage to get a unique message ID. For example RegisterWindowMessage("Kerry's special message") will always return the same unique message ID for an entire session. Now you can broadcast this message to all top level windows and the other programs which are expecting this message can handle it.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
When i show my dialog box iam calling this code in WM_INITDIALOG.I am loading the xml parser whenever i show my dialog box.I think that might be the problem for memory increase.What is the exact error.
IXMLDOMDocument2 *pIXMLDOMDocument2=NULL;
IXMLDOMNodeList *pIXMLDOMNodeList=NULL,*pIXMLDOMNodeList1=NULL;
IXMLDOMNode *pIXMLDOMNode=NULL,*pIXMLDOMNode1=NULL,*nextItem=NULL;
IXMLDOMNamedNodeMap *pIXMLDOMNamedNodeMap1 = NULL;
IClassFactory *pIClassFactory=NULL;
char strpath[300];
GetModuleFileName(NULL,strpath,300);
int len=strlen(strpath);
while(strpath[len]!='\\')
{
len=len-1;
}
strpath[len]='\0';
int retval=PathFileExists(strcat(strpath,"\\testing.xml"));
if(retval)
{
try
{
HRESULT hr;
CoInitialize(NULL);
hr=CoGetClassObject(CLSID_DOMDocument,CLSCTX_SERVER,NULL,IID_IClassFactory, (LPVOID*)(&pIClassFactory));
pIClassFactory->CreateInstance(NULL,IID_IXMLDOMDocument, (LPVOID*)(&pIXMLDOMDocument2));
if(SUCCEEDED(hr))
{
HWND BrowserWindow=(HWND)GetCommandLine();
DestroyWindow(BrowserWindow);
VARIANT_BOOL boolvalue;
VARIANT myvar;
myvar.vt=VT_BSTR;
myvar.bstrVal=L"testing.xml";
VARIANT Fieldname;
Fieldname.vt=VT_BSTR;
pIXMLDOMDocument2->put_async(FALSE);
VARIANT Tablename;
Tablename.vt=VT_BSTR;
HRESULT hrload;
long Tablelen;
hrload=pIXMLDOMDocument2->load((_variant_t)myvar.bstrVal,&boolvalue);
pIXMLDOMDocument2->selectNodes((_bstr_t)"DATABASE/TABLE",&pIXMLDOMNodeList);
pIXMLDOMNodeList->get_length(&TotTablelen);
hrload=pIXMLDOMDocument2->load((_variant_t)myvar.bstrVal,&boolvalue);
pIXMLDOMDocument2->selectNodes((_bstr_t)"DATABASE/TABLE[@Left]",&pIXMLDOMNodeList);
pIXMLDOMNodeList->get_length(&Tablelen);
HWND hListBox=GetDlgItem(hDlg,IDC_LIST);
for(int i=0;i< Tablelen;i++)
{
pIXMLDOMNodeList->get_item(i,&pIXMLDOMNode);
pIXMLDOMNode->get_attributes(&pIXMLDOMNamedNodeMap1);
pIXMLDOMNamedNodeMap1->getNamedItem((_bstr_t)"Name",&pIXMLDOMNode);
pIXMLDOMNode->get_nodeValue(&Tablename);
SendMessage(hListBox,LB_ADDSTRING,0,(LPARAM)(char *)(_bstr_t)Tablename);
}
}
}
catch (_com_error &e)
{
MessageBox(NULL,(char*)e.Description(),NULL,MB_OK);
}
}
CHECK_AND_RELEASE(pIXMLDOMDocument2);
CHECK_AND_RELEASE(pIXMLDOMNodeList);
CHECK_AND_RELEASE(pIXMLDOMNodeList1);
CHECK_AND_RELEASE(pIXMLDOMNamedNodeMap1);
CHECK_AND_RELEASE(pIXMLDOMNode);
CHECK_AND_RELEASE(pIXMLDOMNode1);
CHECK_AND_RELEASE(nextItem);
CoUninitialize();
}
|
|
|
|
|
What are you asking about? What error is happening? Or are you wondering why your memory usage goes up?
The code has a lot of errors in it, such as:
Use PathRemoveFileName() and PathAppend() to make the XML name; your current code is not DBCS-safe.
Use CoCreateInstance() to create the XML parser object in one call.
CLSCTX_SERVER isn't a valid constant, should be CLSCTX_INPROC_SERVER.
You don't initialize your VARIANTs.
L"testing.xml" is not a BSTR
and so on.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi,
We are using these with VC+ 6.0:
<br />
OnPrint()<br />
{<br />
CPrintDialog printDlg(FALSE);<br />
<br />
if (printDlg.DoModal() == IDCANCEL)
return;<br />
----------------<br />
}<br />
So if we choose OK then it will Print, Cancel then not (return)
What can we do to print immediately ... without having to select OK button ... any trick to skip this without confirm?
Thanks
|
|
|
|
|
Look at CView::OnPreparePrinting
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
Thanks for the tip, I will ry.
Regards,
|
|
|
|
|
Hi.
I would like to import a bitmap into Visual C++ resource editor as an icon. The bitmap is 32x32 pixel (*.bmp format.) There is no option in resource editor to import a bitmap as an icon. I would like to what the procedure for creating and implementing an icon for an MFC program.
For example, do you need an icon editor? Imaged editor such as Photoshop do not have an option to save a bitmap as an icon (*.ico format)
Thanks,
Kuphryn
|
|
|
|
|
- Create a new icon in the resource editor.
- Open the bitmap.
- Press ctrl-A (select all).
- Press ctrl-C (copy).
- Go back to the window where the icon is being edited.
- Press ctrl-V (paste).
This should let you convert the bitmap to an icon. You may have to play with things a bit. For example, if the bitmap is 256 colors, you will need to create a 256 color icon to paste it in to.
Gary R. Wheeler
|
|
|
|
|
Okay. Thanks.
There are nine icons in the MFC icon package. I
downloaded IconCool Editor in imported a complete site of
the same icon. I renamed the original MFC icon and use
the new icon. Everything looks good.
Icon design can be difficult especially under low
resolution.
Kuphryn
|
|
|
|
|
I'm writing a program employing sprite animation. Each sprite holds its image in the form of a device-dependent bitmap (a HBITMAP) as well as other data that will allow it to be rendered. In order to render this bitmap onto a display surface, the bitmap needs to be selected into a memory DC first. My question: is it better to create a temporary memory DC every time the sprite needs to be rendered (then delete this DC after you've done rendering), or to create a permanent memory DC so that you don't have to create a DC everytime the sprite needs rendering. The "permanent DC" method would presumably be faster than the "temporary DC" method since you don't have to create the DC every time you render, but requires memory to hold the DC. How much speed improvement would having a permanent memory DC bring? and how much memory penalty?
(As an aside, I could make the sprite hold a DIB instead of a DDB and then render the DIB with DrawDibDraw, StretchDIBits, or SetDIBitsToDevice, which doesn't require a source DC. But would this method be significantly slower?)
Sorry for the long post. Any reply would be greatly appreciated.
Henry
|
|
|
|