|
NYTSX wrote: can this be done with CAsyncSocket?
Try CAsyncSocket::GetPeerName(...) if you are connected it will return with peername and port otherwise call GetLastError for WSAENOTCONN macro
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
i have been playing around with NTFS reparse points and junctions. I finally found the tutorial by Mike Nordell and managed to make my application work. I can now build a junction to a path like "C:\mydirectory".
My question is concerned with building junctions over the network. If i specify "\\ServerXYZ\mydirectory" as the target path, the DeviceIOControl() routine returns unsuccessfully and GetLastError() returns 4392, which means that the parameter structure must have an error. Something is wrong with the way i'm specifying the path!
Is it possible to use the DeviceIOControl() routine setting a junction point that is located on another computer?
Thanks in advance...
|
|
|
|
|
I believe junctions are only possible on the local computer and on only on ntfs.
John
|
|
|
|
|
Hi,
on my wizards first page the user has to make a choice, and according to this choice the page displayed when the "next"-button is pushed should be chosen (because there are different possibilities). How can I arrange that in my program???
I used CPropertySheet, CpropertyPage and SetWizardMode() in my program.
Thanks in advance!
|
|
|
|
|
have a look at CPropertyPage::OnWizardNext ; you can return the ID of the next property page to be displayed.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When I execute my program, I encounter a very strange error,
this error occurs only in "Release log" version and
"Debug" version, But in "Release" version, everything is ok.
The difference between "Release log" and "Release" version is only "print log", but when I comment out "print log" codes,
The "Release log" version still has error.
Who can tell me the reason,Thanks a lot!
|
|
|
|
|
chenxiujie wrote: very strange error
What error ?
chenxiujie wrote: is only "print log",
Are you sure about that ? Is really _every_ setting the same in both versions ?
~RaGE();
|
|
|
|
|
It sounds like you still have some code differences to track down.
Look at you "print log" code.
|
|
|
|
|
How can I get from registry an application associated with given file extension?
krasy
|
|
|
|
|
search the HKEY_CLASSES_ROOT\.xxx key where .xxx is the extension you are looking for.
this key contains a string, let's say abcdefgh.
now, search the HKEY_CLASSES_ROOT\abcdefgh\shell\open\command key, where abcdefgh is the string found on the previous key.
this key contains a string, such as "C:\Program Files\MyProgFolder\myProg.exe" "%1".
here it is !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
Use AssocQueryString() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
As simple as possible, thanks...
|
|
|
|
|
Anyone know how to do this?
That's the icon that appears in the main part of the taskbar, not the system tray/notification area usually in the bottom right-hand corner of the desktop.
Presumably this is the same icon that appears in the top-left corner of the application's main window, the IDR_MAINFRAME icon in an MFC app. Thing is, I need to be able to change it at run-time, not compile-time.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
did you have a look at the Code generated by the Wizard into OnInitDialog ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Actually, it's an MDI app. But your comment made me realize I could just call SetIcon() for the main window.
I am such a FREAKING MORON sometimes!!! Talk about overlooking the obvious
Thanks
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
|
Hi!
How to select not only all columns (LVS_EX_FULLROWSELECT), but also rest of window to border without fake column?
Example:
3 columns and 3 items (rows)
3 columns have widths - 100, 100, 100.
All ctrl window have width - 400
when I select, f.e., 2nd row - selection rectangle width is 300. How to select 400?
For drawing my control I'm using OwnerDraw
I tried to draw rectangle after last column with selection color, but nothing happends.
<br />
if((nColumn == m_columncount - 1) && bReallySelected)<br />
{<br />
CRect rc(rcSubItem.right, rcSubItem.top, rcWindow.right, rcSubItem.bottom);<br />
pDC->FillRect(rc, &CBrush(GetSysColor(COLOR_HIGHLIGHT)));<br />
DrawGrid(pDC, &rc);<br />
}<br />
where rcWindow = GetClientRect();
rcSubItem = GetSubItemRect(nItem, nColumn);
If try a InvalidateRect(rc) into code - I can see rectangle only when I resizing columns, after that rectangle clears by bg color.
DrawGrid draws a lines (without LVS_EX_GRIDLINES) and all continous lines in outside of rectangle, that bounds all items (column and rows) are not repainting (when resize column lines leave a trace)
But if set LVS_EX_GRIDLINES style (and don't draw lines) "system" lines drawing normally.
I think, maybe, lines and rest of selection draw in other routine?
Where system draws a lines?
|
|
|
|
|
Error occured when i am using GDI+ library in VC++.
but i am include all the necessary thing for the GDI+
i paste the error which i got it , from the editor
reply early
e:\12\mahadlg\gdiplusinit.h(32) : error C2065: 'ULONG_PTR' : undeclared identifier
e:\12\mahadlg\gdiplusinit.h(32) : error C2065: 'token' : undeclared identifier
e:\12\mahadlg\gdiplusinit.h(32) : error C2165: 'left-side modifier' : cannot modify pointers to data
e:\12\mahadlg\gdiplusinit.h(32) : error C2071: 'NotificationHookProc' : illegal storage class
e:\12\mahadlg\gdiplusinit.h(33) : error C2146: syntax error : missing ')' before identifier 'token'
e:\12\mahadlg\gdiplusinit.h(33) : error C2165: 'left-side modifier' : cannot modify pointers to data
e:\12\mahadlg\gdiplusinit.h(33) : error C2071: 'NotificationUnhookProc' : illegal storage class
e:\12\mahadlg\gdiplusinit.h(33) : error C2059: syntax error : ')'
e:\12\mahadlg\gdiplusinit.h(86) : error C2059: syntax error : 'const'
e:\12\mahadlg\gdiplusinit.h(95) : error C2146: syntax error : missing ')' before identifier 'token'
e:\12\mahadlg\gdiplusinit.h(95) : warning C4229: anachronism used : modifiers on data are ignored
e:\12\mahadlg\gdiplusinit.h(95) : error C2182: 'GdiplusShutdown' : illegal use of type 'void'
e:\12\mahadlg\gdiplusinit.h(95) : error C2059: syntax error : ')'
send reply
|
|
|
|
|
You have to update your header files by getting a newer version of the platform SDK. ULONG_PTR is a typedef of unsigned long and is declared in the file BaseTsd.h The oldest file I have it in came in the February 2001 PSDK, which is also the first PSDK that included GDI+ IIRC.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
hi Arends,
i download the new version of platform SDK.
and i include those files in my tools->options->directory
as C:\program files\Microsoft SDK\Include
but now also it get some errors
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2065: 'ULONG_PTR' : undeclared identifier
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2065: 'token' : undeclared identifier
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(32) : error C2071: 'NotificationHookProc' : illegal storage class
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2146: syntax error : missing ')' before identifier 'token'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2071: 'NotificationUnhookProc' : illegal storage class
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(33) : error C2059: syntax error : ')'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(86) : error C2059: syntax error : 'const'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : error C2146: syntax error : missing ')' before identifier 'token'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : error C2182: 'GdiplusShutdown' : illegal use of type 'void'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusInit.h(95) : error C2059: syntax error : ')'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2639) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2639) : error C2440: 'initializing' : cannot convert from 'int' to 'enum Gdiplus::Status'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : error C2146: syntax error : missing ')' before identifier 'token'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : error C2182: 'GdiplusNotificationUnhook' : illegal use of type 'void'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\GdiplusFlat.h(2644) : error C2059: syntax error : ')'
reply early
send reply
|
|
|
|
|
maharaja pandian wrote: 'ULONG_PTR' : undeclared identifier
maharaja pandian wrote: i download the new version of platform SDK.
and i include those files in my tools->options->directory
as C:\program files\Microsoft SDK\Include
The fact that ULONG_PTR is undeclared is your first clue. It means that your compiler is still using the old version of BaseTsd.h. What you have to do is move the PSDK include directory to the top of the list of directories. You probably added it to the bottom of the list. The compiler searches the directories listed from the top to the bottom.
Do the same with the lib files, you do not want your program linking to the old lib files.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi there,
I am using a code in VC++ (Console Win32 Application) used to connect to MYSQL. This was a successful attempt So what I think is no problem with library includes but as I tried the same code with MFC (Dialog based Application ) it returned the following linker errors:
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_query@8
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_close@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_free_result@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_num_rows@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_fetch_row@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_num_fields@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_fetch_field@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_store_result@4
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_select_db@8
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_real_connect@32
DlgAddUser.obj : error LNK2001: unresolved external symbol _mysql_init@4
Debug/Job_Scheduler.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.
Please help me in this regard as soon as possible.
Best Regards
Asif Rogers
|
|
|
|
|
Have you added the LibMySQL.lib file to your list of libraries to be linked to your project? Try placing this in your file:
#include "MySql.h"
#pragma comment(lib, "LibMySQL.lib") It's been a while since I have played with MySQL, so I may be off base here.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I'm novice at GDI programming.
I've been working on the program which caputres the screen and saves it as a Jpeg image.
I made it. However It is really inefficient, I thought.
here is my work flow.
1. Get compatible screen DC.
2. Get compatible bitmap on it.
3. Write Bmp header and body using bitmap above.
4. Convert the bmp to Jpeg.
5. Delete bmp file.
What I mostly want to know is..
Should I make bmp file to get Jpeg image?
Could you recommend better way?
thanks.
|
|
|
|