|
Define "does not work." How big is buffer ? Don't the lines need to be terminated with a \n character so that it is output correctly.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
by doing this, the only thing that shows up on the web page is the top part of the page i created, then "It is now" and then on the following line is "variable status" but what i wanted it to do is after "It is now" it should show the correst date on the webpage.
in powerpoint this javascript works.
.
.
.
strcat( buffer,
" "
"It is now "
"<!--"
"var currentTime = new Date();\r\n"
"var day = currentTime.getDate();\r\n"
"var month = currentTime.getMonth();\r\n"
"var year = currentTime.getFullYear();\r\n"
"document.write(day + / + month + / + year);\r\n"
"\r\n"
" VARIABLE STATUS "
.
.
.
thanks...;)
|
|
|
|
|
Show me the relevant pieces of your code that create the HTML file and then write to it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hDevice = SetupDiGetClassDevs(pGuid,NULL,NULL,DIGCF_PRESENT);
' VB fials every time with hDevice = -1 = INVALID_HANDLE_VALUE
'and GetLastError() = 0 = ERROR_SUCCESS
hDevice = SetupDiGetClassDevs(ClassGuid, 0&, 0&, DIGCF_PRESENT)
Both pGuid and ClassGuid contain the exact same GUID data.
Does anyone have any ideas why this 'C' function would fail when called from VB?
Ya! Ya! This is basicaly a VB question, but I am a C/C++ programmer so I am asking here first.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
ClassGuid is a GUID pointer.. Did you declare the first parameter of the function as by ref?
|
|
|
|
|
Yes I did, even though that is the default in VB. I even tried some slight of hand, by changing the prototype slightly and passing the actual pointer via VarPtr(), but it made no difference in the result. What bothers me is that I had to pass ClassGuid to the SetupDiClassGuidsFromNameA function inorder to fill the GUID structure and it succedes every time. I can even use the various slight of hand modifications, I tried with SetupDiGetClassDevs, on SetupDiClassGuidsFromNameA and it still succedes.
Any way I think the guys on the VB forum may be able to help. I've been ask to post the code, and I will be doing that there on monday (since I do not have it here).
Mean while I just wrapped it up in an ATL COM object (ActiveX control), so that I could consentrate on other details for awhile.
F.Y.I. I found a free program on the www called ApiViewer.exe (ApiViewer 2004) that produces declarations for almost every thing, unlike the viewer that comes with VB. Although you need to verify that they are correct yourself, since the prototype for SetupDiGetClassDevs was incorrect (no return value specified).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
how to add a pop-up menu (which contains a few of menu items) to shell menu of widows explorer?
(shell menu will be displayed when right-click files on windows explorer)
the new pop-up menu is not for a specified extension, it is available for all files - similar to "Send to" pop-up menu.
thx
|
|
|
|
|
|
they are sub-menus of "File", not sub-menus of context help menu which is displayed when you right-click files on Windows explorer.
I read this article before but it is not what i exactly need.
includeh10
|
|
|
|
|
I would also read Michael Dunn[^]'s other shell articles. I have them saved to my
PC, and they're a better resource than the platform SDK! I have plagiarisedused
them extensively for my own shell toys.
Iain.
|
|
|
|
|
i read all but i can not find i needed - his story told how to add sub-menus under popup menu "Open" - i want to create my own pop-up menu which is at the same level as "Open".
includeh10
|
|
|
|
|
Hello Gurus,
I am writing an AutoRun.exe for my CDs/DVDs. I am not that familiar with C++/VC++ environments. How can I reference "SYSTEM32.DLL" and use function "GetPrivateProfileString()"? Prefer in C++/VC++ 7 & Unmanaged Code.
I am trying to avoid .NET FrameWork dependencies because not every machine loaded with .NET FrameWork. Any input is greatly appeciated. Wish you a happy & thriving 2005.
Khang
|
|
|
|
|
Include windows.h and link with kernel32.lib. From there you can call the function just like any other.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks so much for your quick reply. How do I "link with kernel32.lib"?
Khang
|
|
|
|
|
Depending on the type of project created, I would suspect that kernel32.lib is linked in by default. If not, just add it to the linker options like any other library.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Dear all,
i am recently working on a project using DirectX 8.1 and VC++.NET. I need to develop the program under fullscreen mode. Then i realize i need to add a printing function, to call the printers connected and print some documents and pictures in the program. I have some knowledge on how to do it using MFC, but not under the circumstance i described above.
So i welcome the nice gentlemen who know this trick enlighten me abit. thank you very much in advance.
cheers
stan
The man of tomorrow is shaped by his battles today.
|
|
|
|
|
This is just a guess but I would think that printing is printing regardless of what is happening on/with the screen. Is that not true?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks, David. I'm trying various means to solve it. =)
|
|
|
|
|
Does anyone have the source code of an audio decoder and encoder?
I want to encode the sound of a TV capture card and then send it through internt to the client which then decode and play the sound.
Really Thanks a lot for your kind help!!~
|
|
|
|
|
Hi. I'm trying to create a C++ class with a const static member variable of type valarray, but i do not know how to declare and initialize it. Can anyone help me?
|
|
|
|
|
class foo
{
public:
static const std::valarray < int > m_array;
};
const std::valarray< int > foo::m_array(-1, 5);
int main(int argc, char* argv[])
{
for (int i=0;i<5;i++)
{
printf("%d,", foo::m_array[i]);
}
return 0;
}
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
Thanks for your answer. Two more questions...:
1) I'm trying to define a non static valarray member, stores 15 elements of type double, but without success. All help i found defines valarrays within main(). I tried the same definitions for my class but dose not work. Actually i tried:
class myClass
{
private:
std::valarray<double> m_array;
}
With this the compiler is ok, but when i tryied to asing values to m_array with [] operator, program crashes (actually this is logical because the m_array is of size 1, i think...).
class myClass
{
private:
std::valarray<double> m_array(15);
}
VC++ 2003 comliler generates the following error :
error C2059: syntax error : 'constant'
2) The valarray allocates memory dynamically on the heap or statically? So if i want a huge valarray (say 10000 elements) is this ok:
std::valarray<double> hugeArray(10000);
or i have to allocate the valarray dynamically using a pointer?
Thanks again.
|
|
|
|
|
for #1, you can use C++'s "initialization list" feature on your constructor:
#include < valarray >
class myClass
{
public:
myClass() : m_array(15)
{
}
private:
std::valarray< double > m_array;
};
you can add simple constructor 'calls' to your member ojects right to your own objects c'tor. very handy.
for #2, the elements are allocated dynamically by the valarray's ctor, via the "new" operator.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
Thanks again. That was very helpfull for me.
while(living)
{
i'm learning;
}
|
|
|
|
|
I am having a problem with CFileDialog. Have a look at this code:
CString strFirst = "C:\\1.txt";
CString strSecond = "C:\\aa\\1.txt";
CopyFile(strFirst, strSecond, FALSE);
This code is simply copying a file 1.txt to a folder named aa present at C root. After I do this and I try to delete folder aa(while my application is still running), it lets me delete it and that's OK. Now have a look at the problem code:
CFileDialog dlg(false);
CString strPathName;
if(dlg.DoModal() == IDOK)
{
strPathName = dlg.GetPathName();
CopyFile(strFirst, strPathName, FALSE);
}
Now, if I select the same folder in CFileDialog and create a file there, it copies it quite well thru CopyFile function. The problem is that If I try to delete folder aa now (with my application still open), it wont let me delete it although I can delete the newly created file inside this folder but deletion of folder is not possible. It gives an error message saying that this folder is in use by some other program.
Am I doing something wrong or is it a bug in CFileDialog. I think it is a bug. Looks like CFileDialog is not releasing the handle of the folder. What is your opinion.
I hated going to weddings. All the grandmas would poke me saying "You're next". They stopped that when I started doing it to them at funerals.
My Articles
|
|
|
|