eliangela 0 Denunciar post Postado Julho 20, 2009 Olá pessoal. Sou programador Java e gostaria de fazer uma DLL em C++ para alterar a data e hora do sistema. Estou "dando meus pulos" pra construir o código, mas ainda não está funcionando. estou usando o Compilador Dev c++ da Borland. Segue o código: //dllmain.cpp #include "unidll.h" #include <windows.h> #include <winbase.h> SYSTEMTIME *time = new SYSTEMTIME(); BOOL setDateTime(WORD year, WORD month, WORD day, WORD hour, WORD minute, WORD second) { time.wYear = year; time.wMonth = month; time.wDayOfWeek = 0; time.wDay = day; time.wHour = hour; time.= minute; time.wSecond = second; time.wMilliseconds = 0; return SetSystemTime(time); } DllClass::DllClass(){ } DllClass::~DllClass (){ } BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved){ switch (reason){ case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } } e os Erros: wYear has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wMonth has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wDayOfWeek has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wDay has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wHour has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wMinute has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wSecond has not been declared dllmain.cpp request for member of non-aggregate type before '=' token wMilliseconds has not been declared dllmain.cpp request for member of non-aggregate type before '=' token Por favor, me ajudem a resolver. Ainda estou aprendendo C++. Compartilhar este post Link para o post Compartilhar em outros sites
_Isis_ 202 Denunciar post Postado Julho 20, 2009 P/ se usar ponteiros é -> http://msdn.microsoft.com/en-us/library/ms724950(VS.85).aspx Compartilhar este post Link para o post Compartilhar em outros sites
eliangela 0 Denunciar post Postado Julho 20, 2009 RESOLVIDO! Obrigada pela ajuda! O código ficou assim: #include "unidll.h" #include <windows.h> #include <winbase.h> bool setDateTime(int year, int month, int day, int hour, int minute, int second) { SYSTEMTIME time; time.wYear = year; time.wMonth = month; time.wDay = day; time.wHour = hour + 2; time.wMinute= minute; time.wSecond = second; return SetSystemTime(&time); } faltou um & na frente da variável time Compartilhar este post Link para o post Compartilhar em outros sites
andre002 0 Denunciar post Postado Abril 11, 2010 Gente estou com um probleam similar, baixei um livro de visitas e não sei qual o lugar para arrumar a hora e a data, que estão em outro formato, o livro de visitas que eu baixei é esse: http://www.scriptbra...ad/codigo/6643/ Gostaria que alguem que entende melhor do que eu me desse uma dica de onde esta o local para configurar a data e a hora para formato nacional Desde Já Obrigado!! Compartilhar este post Link para o post Compartilhar em outros sites
_Isis_ 202 Denunciar post Postado Abril 12, 2010 A princípio, isto é um fórum de C/C++, e não PHP+JS+CSS. Poste na área correta e não sequestre tópicos de outras pessoas inutilmente. Compartilhar este post Link para o post Compartilhar em outros sites