|
it maight not have been installed with the other parts of your Visual Studio environment...
|
|
|
|
|
I made a console project with my VC++ 6.
|
|
|
|
|
Hi,
I currently porting some code from Linux to Windows. I have decided against a windows implementation of the POSIX threading libraries and opted for windows threading.
Previously in my code, I had conditional run conditions using the pthread_cond_t, is there an equivalent in the windows threading API?
Any help would be greatly appreciated,
Paul.
|
|
|
|
|
paul_a_chapman wrote: I have decided against a windows implementation of the POSIX threading libraries and opted for windows threading.
That was a mistake
paul_a_chapman wrote: I had conditional run conditions using the pthread_cond_t, is there an equivalent in the windows threading API?
Unfortunatelly, no, at least not directly. Look here[^] for a workaround.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Thanks for your reply, that link is useful. I did try using the win32 pthread libraries, but I kept getting exception errors. The code functions correctly on linux but not with the win32 pthreads library. The decision was made above me to use windows threading api.
Thanks again.
Paul.
|
|
|
|
|
1. barcode is drawn by lines (space and bar), why does it need font? font is useless when we draw lines.
2. what is correct width of bar or space? - i.e. 0.2 mm etc.
3. what is correct height of barcode?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
includeh10 wrote: 1. barcode is drawn by lines (space and bar), why does it need font? font is useless when we draw lines.
See here.
includeh10 wrote: 2. what is correct width of bar or space? - i.e. 0.2 mm etc.
A barcode is comprised of bars and spaces. I believe the leftmost bar, which is one unit wide, sets the stage for the remaining bars and spaces.
includeh10 wrote: 3. what is correct height of barcode?
I believe it is governed by the product on which the barcode is placed. For example, a large box can afford to have a large barcode where as box of cookies could not. Another determining factor is how far will the scanner be from the box.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I'm writing an application, where I need to save links to external documents (.xls, .doc, .txt, ...). In Windows, when I double-click to such a file, it'll be opened automatically by the corresponding application.
double-click to test.xls opens Microsoft Excel
double-click to test.doc opens Microsoft Word
double-click to test.tif opens the corresponding graphical application
and so on...
How can I implement this functionality in my application, working under Visual C++ / MFC ?
regards
Alfred Willi
|
|
|
|
|
a type of file (extension) is associated with an application.
u can find all info about this in system register (run regedit.exe).
e.g. doc file can be opened by Microsoft word.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Alfred Willi wrote:
How can I implement this functionality in my application, working under Visual C++ / MFC ?
Use ShellExecute() with the "open" verb will open the associated application.
Otherwise, if you are wanting to know how to register your own file type, this is handled for you automatically by MFC's AppWizard. It will create a .reg file in your project that can be merged on the target machine. Check out CWinApp::EnableShellOpen() and CWinApp::RegisterShellFileTypes() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi David
Your answer was exactly the information I was looking for. Your answer was very helpful for me. Thanks a lot.
Alfred Willi
|
|
|
|
|
Hello i am working with MFC. I want to display a full screen with blue color. I can give you an example. When Windows 2000 starts up. After booting it requires network password. At that time, Background is blue. I want to ask how can i do it?
Thank you.
We Believe in Excellence
|
|
|
|
|
Hi, I'm searching for a few days now for a tutorial of an example to see all the computers that are in my lan.
Does anybody has this for me?
Greetings,
Spike
|
|
|
|
|
Try NetServerEnum() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have this code, but it seems Visual Studio .Net has trouble with WNetOpenEnum, WNetEnumRecources and WNetCloseEnum.
CString strTemp;<br />
CListBox *pList = (CListBox*) GetDlgItem(IDC_LIST1);<br />
pList->ResetContent();<br />
<br />
struct hostent *host; <br />
struct in_addr *ptr;
<br />
DWORD dwScope = RESOURCE_CONTEXT;<br />
NETRESOURCE *NetResource = NULL; <br />
HANDLE hEnum; <br />
WNetOpenEnum( dwScope, NULL, NULL, NULL, &hEnum ); <br />
<br />
WSADATA wsaData; <br />
WSAStartup(MAKEWORD(1,1),&wsaData);<br />
<br />
if ( hEnum ) <br />
{<br />
DWORD Count = 0xFFFFFFFF;<br />
DWORD BufferSize = 2048;<br />
LPVOID Buffer = new char[2048];<br />
WNetEnumResource( hEnum, &Count, Buffer, &BufferSize );<br />
<br />
NetResource = (NETRESOURCE*)Buffer;<br />
<br />
char szHostName[200];<br />
<br />
for ( unsigned int i = 0; i < BufferSize/sizeof(NETRESOURCE); i++, NetResource++ )<br />
{ <br />
if ( NetResource->dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY )<br />
{<br />
if ( NetResource->lpRemoteName )<br />
{<br />
CString strFullName = NetResource->lpRemoteName;<br />
<br />
if ( 0 == strFullName.Left(2).Compare("\\\\") )<br />
strFullName = strFullName.Right(strFullName.GetLength()-2);<br />
<br />
gethostname( szHostName, strlen( szHostName ) );<br />
host = gethostbyname(strFullName);<br />
ptr = (struct in_addr *) host->h_addr_list[0];<br />
<br />
int a = ptr->S_un.S_un_b.s_b1;
int b = ptr->S_un.S_un_b.s_b2;
int c = ptr->S_un.S_un_b.s_b3;
int d = ptr->S_un.S_un_b.s_b4;
<br />
strTemp.Format("%s --> %d.%d.%d.%d",strFullName,a,b,c,d);<br />
pList->AddString(strTemp);<br />
}<br />
}<br />
}<br />
delete Buffer;<br />
WNetCloseEnum( hEnum );<br />
}<br />
WSACleanup();
|
|
|
|
|
This is code I've used successfully in the past:
WSADATA wsaData;
DWORD dwResult,
dwCount = 0xffffffff,
dwBufferSize = 16384;
HANDLE hEnum;
LPVOID lpBuffer;
LPNETRESOURCE lpNetResource = NULL;
dwResult = WSAStartup(MAKEWORD(1, 1), &wsaData);
if (0 == dwResult)
{
dwResult = WNetOpenEnum(RESOURCE_CONTEXT, RESOURCETYPE_ANY, NULL, NULL, &hEnum);
if (NO_ERROR == dwResult && NULL != hEnum)
{
lpBuffer = new BYTE[dwBufferSize];
dwResult = WNetEnumResource(hEnum, &dwCount, lpBuffer, &dwBufferSize);
if (NO_ERROR == dwResult && dwCount > 0)
{
lpNetResource = (LPNETRESOURCE) lpBuffer;
while (NULL != lpNetResource)
{
...
lpNetResource++;
}
}
delete [] lpBuffer;
}
dwResult = WSACleanup();
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks for the code, but again thesame. I get these errors:
NetSender error LNK2019: unresolved external symbol _WNetEnumResourceA@16 referenced in function "public: void __thiscall CNetSenderDlg::View(void)" (?View@CNetSenderDlg@@QAEXXZ)
NetSender error LNK2019: unresolved external symbol _WNetOpenEnumA@20 referenced in function "public: void __thiscall CNetSenderDlg::View(void)" (?View@CNetSenderDlg@@QAEXXZ)
NetSender fatal error LNK1120: 2 unresolved externals
|
|
|
|
|
jspike wrote: Thanks for the code, but again thesame. I get these errors:
please include this line in your cpp file
#pragma comment(lib,_T("Mpr.lib"))
"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
|
|
|
|
|
It works, thank you
|
|
|
|
|
Hi All,
I have an utility programme that uses wchar_t. However interfacing to our programme which uses char's is a problem.
How does one convert to wchar_t to char, and visa versa?
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
|
Check out the W2A() and A2W() macros.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
wctomb and mbtowc
"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
|
|
|
|
|
i have my database in 61.247.251.97(My system)
how to Acesss Remote Database through Internet
I use the ADO for connecting the database.
I use the following connection string:
_bstr_t m_Conn("PROVIDER=SQLOLEDB.1;Server=61.247.251.97;Database=IstEncoder;uid=sa;pwd=sa;");
JAYARAJ
-- modified at 23:28 Tuesday 21st March, 2006
|
|
|
|