Since setting of href
does not necessary stop the scripts and jump to new address, I think that else
is required. But the code can be probably replaced with a single line like this:
window.location.href = "...&consultar=" + accion;
Since setting of href
does not necessary stop the scripts and jump to new address, I think that else
is required. But the code can be probably replaced with a single line like this:
window.location.href = "...&consultar=" + accion;
It seems easier to convert from FILE *
to HANDLE
:
#include <io.h>
#include <fcntl.h>
FILE * f = . . .;
HANDLE h = (HANDLE)_get_osfhandle(fileno(f));
The other conversion looks longer:
HANDLE h = . . .
FILE * f = _fdopen(_open_osfhandle((intptr_t)h, _O_RDONLY), "rb");
I hope this works. I am not sure mixing of operations with FILE *
and HANDLE
cannot be avoided.
prasad_som wrote:
You need to call CFile::Close before using CArchive::Close
In my opinion the file must be closed after closing the archive. Otherwise it will be impossible to flush the last data kept in an internal buffer of CArchive
. If the CFile
and CArchive
objects are created on the stack, then they will be closed automatically in right order.
I think if your _wfopen
function looks like this:
_wfopen(. . ., "r");
then you have to change it to this:
_wfopen(. . ., L"r");
I hope this helps.
Stick^ wrote:
[...]By unroll are you meaning something like this[...]
Yes (actually you need one more ++
: return *++code == 0
). Or even like this:
inline bool Xpdr::IsValidCode(const wchar_t * code) const
{
return
code[0] >= '0' && code[0] <= '7' &&
code[1] >= '0' && code[1] <= '7' &&
code[2] >= '0' && code[2] <= '7' &&
code[3] >= '0' && code[3] <= '7' &&
code[4] == 0;
}
I think a possible alternative solution is:
//static
bool Xpdr::IsValidCode(const wchar_t * code) const
{
for( int i = 0; i < 4; ++i, ++code)
{
if( *code < '0' || *code > '7')
{
return false;
}
}
return *code == 0;
}
I hope this works. In addition you can "unroll" this short loop and replace it with a series of "if"-s and autoincremented code
pointer. -- modified at 5:47 Tuesday 28th November, 2006
In MSDN documentation. For example: http://msdn2.microsoft.com/en-us/library/56e442dc(VS.80).aspx[^].
Since fmtValue.doubleValue
is a float value, I do not think the "%d
" format specifier is appropriate. You should try "%f
" or "%g
":
sentinfo.Format( "%.3f", fmtValue.doubleValue);
I hope this helps.
It seems your m_Button
and m_Chart
variables were not associated with child controls. Did you create your child controls with Create
member, like m_Button.Create(. . .)
, or in a different way? Maybe you should show us more details.
I think you can try this:
SetVolumeLabel(_T("F:\\"), _T("KIRAN"));
I hope this works.
A conversion like
char * buf = (char *)(LPCTSTR)m_strAddBlob;
is not correct in case of Unicode strings -- the result looks like a string consisting of the first character only. I think you first have to convert your string from Unicode to Ansi. In new MFC this can be done like this:
CStringA ansi(m_strAddBlob);
Then if you actually need a pointer to constant string, then you can use explicit cast:
const char * buff = ansi;
If you realy need a pointer to non-constant string and modify the string, then use GetBuffer
and ReleaseBuffer
functions:
char * buff = ansi.GetBuffer();
. . .
ansi.ReleaseBuffer();
I hope this helps.
super_ttd wrote:
why does intellisense tell me SHParseDisplayName() wants a LPWSTR then ?
I cannot explain this. In my case it tells me that the first parameter is of PCWSTR
type.
I think the static
is for the case your array is declared locally in a function. If it is a global variable and is accessed from other modules, then do not add static
(otherwise it becomes available from the current file only).
Since SHParseDisplayName
requires LPCWSTR
, the proposed solution should work:
::SHParseDisplayName(CT2W(m_strFolder), . . .);
super_ttd wrote:
[...] the compiler (VC7.1) complains about the A2W() macro [...]
Try the newer improved CA2W
macro. Actually I think you need CT2W
macro. The correct shortest usage:
::SHParseDisplayName(CT2W(m_strFolder), . . .
Then try the rest of the code again. I hope this helps.
If no other solution, I think you can store the item number as a private data:
lvItem.mask = ... | LVIF_PARAM;
. . .
lvItem.lParam = (LPARAM)i;
pMatrixListResults->InsertItem(&lvItem);
Later obtain this number from the NMCUSTOMDRAW
structure:
LPNMLVCUSTOMDRAW pLVCD = (LPNMLVCUSTOMDRAW)pNMHDR;
int number = (int)pLVCD->nmcd.lItemlParam;
I hope this works.
I think that after un-defining the definition, the original CreateWindow
functions from Windows API will not be more available inside the implementation of the other CreateWindow
member.
Since MapViewOfFile
returns a pointer to shared memory:
LPVOID ptr = MapViewOfFile(. . .)
I think you should use it as the destination in a string-copy operation:
lstrcpyW((LPWSTR)ptr, xml)
where xml
is the XML string to by copied. Probably it can be obtained from your IXMLDOMDocument2
object like this:
_bstr_t xml = myDocument->xml
I hope this helps.
I think you can try the save
member of parent DOMDocument
object, but it writes the entire XML document, not only your element. If you need just one element, I think you can obtain the XML representation of the node using xml
property, probably like this:
_bstr_t xml = myNode->xml;
Then write this string using file functions. Note that in case of text node, the returned XML string probably will not differ very much from the value you passed to createTextNode
function. I hope this helps.
I think this is a feature of Windows OS -- beeping if a key cannot be processed by the focused control, like button. Maybe you should return TRUE
from your PreTranslateMessage
for all of your keys, thus stopping further processing? I hope this helps.